GNOME Bugzilla – Bug 734380
path-layer: Stop invalidate_canvas idle callback when called for the first time
Last modified: 2014-08-11 21:30:38 UTC
In schedule_redraw function we add an idle that invalidates the visible canvas, once called, we need to remove the idle from the list of event sources. If we don't do that, champlain indiscriminately executes the idle callback hanging the CPU. And worse, it will add more idles when it needs to call schedule_redraw again (on path node changes for example) without clearing the previous idles.
Created attachment 282739 [details] [review] path-layer: Stop invalidate_canvas idle callback
Review of attachment 282739 [details] [review]: Looks good and pretty obvious to me. Thanks for investigating. I'll merge it since its so obvious (to me). It can be reverted if thats not the case..
Attachment 282739 [details] pushed as 815c47c - path-layer: Stop invalidate_canvas idle callback
Interesting, I would have expected some warning from the compiler about the incompatibility of return types (is there such a gcc flag?). I found one more occurrence in ChamplainScale (fixed in master now).
(In reply to comment #4) > Interesting, I would have expected some warning from the compiler about the > incompatibility of return types (is there such a gcc flag?). Well we would if we were not explicitly casting the function when passing it to g_idle_add This is the reason I tend to avoid casting functions and instead cast the arguments/user_data from the function itself. >I found one more > occurrence in ChamplainScale (fixed in master now). Cool, thanks.