After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 734380 - path-layer: Stop invalidate_canvas idle callback when called for the first time
path-layer: Stop invalidate_canvas idle callback when called for the first time
Status: RESOLVED FIXED
Product: libchamplain
Classification: Core
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: libchamplain-maint
libchamplain-maint
Depends on:
Blocks:
 
 
Reported: 2014-08-06 20:36 UTC by Damián Nohales
Modified: 2014-08-11 21:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
path-layer: Stop invalidate_canvas idle callback (1004 bytes, patch)
2014-08-06 20:36 UTC, Damián Nohales
committed Details | Review

Description Damián Nohales 2014-08-06 20:36:20 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.
Comment 1 Damián Nohales 2014-08-06 20:36:23 UTC
Created attachment 282739 [details] [review]
path-layer: Stop invalidate_canvas idle callback
Comment 2 Zeeshan Ali 2014-08-09 12:32:43 UTC
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..
Comment 3 Zeeshan Ali 2014-08-09 12:36:19 UTC
Attachment 282739 [details] pushed as 815c47c - path-layer: Stop invalidate_canvas idle callback
Comment 4 Jiri Techet 2014-08-11 19:21:30 UTC
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).
Comment 5 Zeeshan Ali 2014-08-11 21:30:38 UTC
(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.