blob: 437f72be86494aa307dd846bcd4d7381798278ed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
Use gdk_threads_enter/gdk_threads_leave to ensure gtk multithread safe
If the video player tries to play an unknown type file, it will enter
the error_cb() function, which is called in another thread.
Use gdk_threads_enter/gdk_threads_leave to ensure the safe of gtk
multi-thread operation.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Upstream-Status: Pending
diff -ruN video-orig/src/video.c video/src/video.c
--- video-orig/src/video.c 2010-10-15 16:07:26.522346398 +0800
+++ video/src/video.c 2010-10-15 16:25:51.780296717 +0800
@@ -96,6 +96,7 @@
{
GtkWidget *dialog;
+ gdk_threads_enter();
dialog = gtk_message_dialog_new (data->window,
GTK_DIALOG_NO_SEPARATOR,
GTK_MESSAGE_ERROR,
@@ -103,6 +104,7 @@
error->message);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
+ gdk_threads_leave();
}
/**
@@ -606,7 +608,9 @@
gtk_widget_show_all (GTK_WIDGET (data->window));
+ gdk_threads_enter();
gtk_main ();
+ gdk_threads_leave();
/**
* Cleanup.
|