[Vala] multithreading -> weird behaviour on win(msys) and macOS
- From: Wolfgang Mauer <wolfgang mauer kabelmail de>
- To: Vala-list <vala-list gnome org>
- Subject: [Vala] multithreading -> weird behaviour on win(msys) and macOS
- Date: Tue, 12 Mar 2019 16:48:45 +0100
I have a strange behavior between Ubuntu/MSYS and macOS
I have a output window (buildTextView) and i like to put all output from
"spawn_async_with_pipes" to the end of the buffer.
With Linux everything works like expected with no errors/warnings but on
Windows(10/MSYS64) and macOS it get lots of errors.
(valaDevelop.exe:2980): Gtk-CRITICAL **: 16:33:50.460:
gtk_text_view_get_buffer: assertion 'GTK_IS_TEXT_VIEW (text_view)' failed
(valaDevelop.exe:2980): Gtk-CRITICAL **: 16:33:50.460:
gtk_text_buffer_get_insert: assertion 'GTK_IS_TEXT_BUFFER (buffer)' failed
(valaDevelop.exe:2980): Gtk-CRITICAL **: 16:33:50.460:
gtk_text_view_scroll_to_mark: assertion 'GTK_IS_TEXT_VIEW (text_view)'
failed
(valaDevelop.exe:2980): Gtk-CRITICAL **: 16:33:50.460:
gtk_text_view_get_buffer: assertion 'GTK_IS_TEXT_VIEW (text_view)' failed
(valaDevelop.exe:2980): Gtk-CRITICAL **: 16:33:50.460:
gtk_text_buffer_insert_at_cursor: assertion 'GTK_IS_TEXT_BUFFER
(buffer)' failed
Any idea ?
Process.spawn_async_with_pipes (".",
spawn_args,
spawn_env,
SpawnFlags.SEARCH_PATH |
SpawnFlags.DO_NOT_REAP_CHILD,
null,
out compiler_pid,
out compiler_input,
out compiler_output,
out compiler_error);
// stdout:
IOChannel compilerOutput = new IOChannel.unix_new
(compiler_output);
compilerOutput.add_watch (IOCondition.IN |
IOCondition.HUP, (channel, condition) =>
{
if (condition == IOCondition.HUP)
return false;
try
{
string line;
channel.read_line (out line, null, null);
// Timeout with 0 goes to "UI-Thread" ?!
GLib.Timeout.add(0, () =>
{
buildTextView.buffer.insert_at_cursor(line, -1);
var mark = buildTextView.buffer.get_insert();
buildTextView.scroll_to_mark(mark, 0, true, 1, 1);
}
}
catch (IOChannelError e)
{
log (null, LogLevelFlags.LEVEL_ERROR, "%s",
e.message);
return false;
}
catch (ConvertError e)
{
log (null, LogLevelFlags.LEVEL_ERROR, "%s",
e.message);
return false;
}
catch (Error e)
{
log (null, LogLevelFlags.LEVEL_ERROR, "%s",
e.message);
return true;
}
return true;
});
Thanks for help
Wolfgang
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]