[gnome-software: 5/6] rpm-ostree: Use the thread-default main context when blocking




commit 08e9f5f42d7e1b17605593489ae85d2e50da01e2
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu Nov 26 00:18:37 2020 +0000

    rpm-ostree: Use the thread-default main context when blocking
    
    Rather than the global default main context (which belongs to the main
    thread). Iterating the global default main context can lead to
    deadlocks, or code executing on the wrong thread (for example, UI events
    being run in the rpm-ostree worker thread).
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Fixes: #1091

 plugins/rpm-ostree/gs-plugin-rpm-ostree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
index 521136f4..e7bde90e 100644
--- a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
+++ b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
@@ -248,7 +248,7 @@ transaction_progress_new (void)
        TransactionProgress *self;
 
        self = g_slice_new0 (TransactionProgress);
-       self->context = g_main_context_ref (g_main_context_default ());
+       self->context = g_main_context_ref_thread_default ();
 
        return self;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]