Re: $drawing_area->queue_draw(); make program crash on some systems



> https://developer.gnome.org/gdk2/stable/gdk2-Cairo-Interaction.html#gdk-cairo-create

> "Note that due to double-buffering, Cairo contexts created in a GTK+

> expose event handler cannot be cached and reused between different

> expose events. "

 

If I understand correctly, this means a Cairo context should not be global, then?

 

> https://developer.gnome.org/gdk3/stable/gdk3-Cairo-Interaction.html#gdk-cairo-create

> "A newly created Cairo context. Free with cairo_destroy() when you are

> done drawing."

 

There is no cairo_destroy method in perl-Cairo (or none, at least, I could not find it). There is a DESTROY method in Cairo.xs that calls the cairo_destroy Cairo internal.

 

If $cr is global, calling $cr=undef; after the last $cr->paint; removes the X error crash.

 

Incidentally, I also need to do $cr=undef; to force a "flush" when I create a pdf file from Cairo (i.e. I can't open the pdf file while the main loop is running, unless I call $cr=undef; after the last paint is done).

 

All of this is fine, but still does not explain why the behaviour is so different between my two systems.

 

From the backtrace, it seems the problem is happening in cairo_surface_flush() from /usr/lib64/libcairo.so.2...

Cheers,

 

Guillaume

 



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