Re: cursor for display segv



On 30.11.2010 22:42, Kevin Ryde wrote:
The program below gets a segv for me with i386 debian "experimental" gtk
2.22 and glib 2.27.3.

I can reproduce this with my development installation, but not with the system's gtk+. The code in question has not changed in quite a few years. I think the different results might be due to the conditional in _gdk_cursor_destroy:

  if (!private->display->closed && private->xcursor)
XFreeCursor (GDK_DISPLAY_XDISPLAY (private->display), private->xcursor);

In the test case, private->display is garbage, so its closed member might come out true or false.

GdkCursor seems to simply assume that the GdkDisplay is valid throughout the cursor's lifetime, but it doesn't take a reference on it. I don't think it's the bindings' responsibility to do something about this. GdkCursor should just take a reference on the display. In the meantime, for your Perl code, I think you will have to keep the display around.



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