mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
Avoid critical error in thread check if source is destroyed
The source can be destroyed by the time we complete the result, and then the g_source_get_context(current_source) call will cause a critical error. We check for the source being destroyed and avoid the check in that case. This means we miss the right-thread check in this case, but thats merely a helper, so this is not critical.
This commit is contained in:
parent
10c7b3a17e
commit
90e1308809
@ -574,7 +574,7 @@ g_simple_async_result_complete (GSimpleAsyncResult *simple)
|
|||||||
|
|
||||||
#ifndef G_DISABLE_CHECKS
|
#ifndef G_DISABLE_CHECKS
|
||||||
current_source = g_main_current_source ();
|
current_source = g_main_current_source ();
|
||||||
if (current_source)
|
if (current_source && !g_source_is_destroyed (current_source))
|
||||||
{
|
{
|
||||||
current_context = g_source_get_context (current_source);
|
current_context = g_source_get_context (current_source);
|
||||||
if (current_context == g_main_context_default ())
|
if (current_context == g_main_context_default ())
|
||||||
|
Loading…
Reference in New Issue
Block a user