From f20da2a7a6e65bcf3a907c3ee5cb5fd69a71c867 Mon Sep 17 00:00:00 2001 From: Mark Harmer Date: Mon, 27 Apr 2015 12:01:19 -0400 Subject: Mainloop fix for possible data loss if closing before save has completed. Fixed bugs: - https://launchpad.net/bugs/967416 (bzr r14060) --- src/extension/implementation/script.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index bbc567f75..52c360fcd 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -1027,7 +1027,10 @@ int Script::execute (const std::list &in_command, return 0; } - _main_loop = Glib::MainLoop::create(false); + // Create a new MainContext for the loop so that the original context sources are not run here, + // this enforces that only the file_listeners should be read in this new MainLoop + Glib::RefPtr _main_context = Glib::MainContext::create(); + _main_loop = Glib::MainLoop::create(_main_context, false); file_listener fileerr; fileout.init(stdout_pipe, _main_loop); -- cgit v1.2.3