Bug 88846

Summary: Log: Loop not properly cleaned up on failures in Log constructor
Product: Zeitgeist Reporter: Albert Astals Cid <aacid>
Component: libzeitgeistAssignee: zeitgeist-bugs <zeitgeist-bugs>
Status: RESOLVED FIXED QA Contact: zeitgeist-bugs <zeitgeist-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: The patch
Generated .c code if unpatched
Generated .c code if patched
The patch

Description Albert Astals Cid 2015-01-28 08:46:57 UTC
If the lambda fails the code leaves a MainLoop around that breaks things (i.e. the Qt main glib loop).

I'm attaching the patch that fixes the problem, the generated code with and the patch.
Comment 1 Albert Astals Cid 2015-01-28 08:48:09 UTC
Created attachment 112905 [details]
The patch

Add finally {} to try {} catch {}
Comment 2 Albert Astals Cid 2015-01-28 08:49:14 UTC
Created attachment 112906 [details]
Generated .c code if unpatched

Note that there's some return; error conditions where the loop is not exited correctly with g_main_loop_quit (_data1_->mainloop);
Comment 3 Albert Astals Cid 2015-01-28 08:49:52 UTC
Created attachment 112907 [details]
Generated .c code if patched

Note that all the exit paths properly have a g_main_loop_quit (_data1_->mainloop);
Comment 4 Albert Astals Cid 2015-01-28 08:51:06 UTC
Please if possible credit this to "Albert Astals Cid <albert.astals@canonical.com>" and not to "Albert Astals Cid <aacid@kde.org>" I'm just using my kde.org account since I didn't feel like creating a new one just for this.
Comment 5 Albert Astals Cid 2015-01-29 15:29:55 UTC
Created attachment 112950 [details] [review]
The patch
Comment 6 Albert Astals Cid 2015-01-29 15:35:56 UTC
It's been commited.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.