[smuxi/stable] Frontend-GNOME: fix illegal memory access from non-main thread in MenuWidget.OnOpenLogActionActivate
- From: Mirco M. M. Bauer <mmmbauer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [smuxi/stable] Frontend-GNOME: fix illegal memory access from non-main thread in MenuWidget.OnOpenLogActionActivate
- Date: Sun, 27 Aug 2017 09:24:23 +0000 (UTC)
commit 0e893a8f8e3ad9e91de9e21db51f59be5f87fedb
Author: Mirco Bauer <meebey meebey net>
Date: Thu Aug 24 16:52:41 2017 -0700
Frontend-GNOME: fix illegal memory access from non-main thread in MenuWidget.OnOpenLogActionActivated()
Accessing ChatViewManager.CurrentChatView has to happen in the main thread as it
is reading GTK+ owned memory.
smuxi-frontend-gnome:25051): WARNING **: Gtk operations should be done on the main Thread
at System.Environment.get_StackTrace () [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at Gtk.Application.AssertMainThread () [0x00000] in <f6dd2edfa65247bd83faaf0a2f883585>:0
at Gtk.TreeStore.GetValue (Gtk.TreeIter iter, System.Int32 column, GLib.Value& value) [0x00000] in
<f6dd2edfa65247bd83faaf0a2f883585>:0
at Gtk.TreeStore.GetValue (Gtk.TreeIter iter, System.Int32 column) [0x00000] in
<f6dd2edfa65247bd83faaf0a2f883585>:0
at Smuxi.Frontend.Gnome.ChatTreeView.get_CurrentChatView () [0x00023] in
/srv/local/home/meebey/Projects/smuxi/src/Frontend-GNOME/Views/ChatTreeView.cs:39
at Smuxi.Frontend.Gnome.ChatViewManager.get_CurrentChatView () [0x00007] in
/srv/local/home/meebey/Projects/smuxi/src/Frontend-GNOME/ChatViewManager.cs:60
at Smuxi.Frontend.Gnome.MenuWidget.<OnOpenLogActionActivated>m__0 (System.Object ) [0x00008] in
/srv/local/home/meebey/Projects/smuxi/src/Frontend-GNOME/Views/MenuWidget.cs:457
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x00000]
in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext
executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean
preserveSyncCtx) [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext,
System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in
<dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem
() [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00000] in
<dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in
<dca3b561b8ad4f9fb10141d81b39ff45>:0
src/Frontend-GNOME/Views/MenuWidget.cs | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/Frontend-GNOME/Views/MenuWidget.cs b/src/Frontend-GNOME/Views/MenuWidget.cs
index 29e17e4..19a2cbd 100644
--- a/src/Frontend-GNOME/Views/MenuWidget.cs
+++ b/src/Frontend-GNOME/Views/MenuWidget.cs
@@ -345,11 +345,10 @@ namespace Smuxi.Frontend.Gnome
Trace.Call(sender, e);
try {
+ var logFile = ChatViewManager.CurrentChatView.ChatModel.LogFile;
ThreadPool.QueueUserWorkItem(delegate {
try {
- SysDiag.Process.Start(
- ChatViewManager.CurrentChatView.ChatModel.LogFile
- );
+ SysDiag.Process.Start(logFile);
} catch (Exception ex) {
Frontend.ShowError(Parent, ex);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]