0

I have copied and compiled the source code available in the section titled "Full Source".

http://cairographics.org/threaded_animation_with_cairo/

I adapted this code to a project that I'm working on only to find that the app would crash when I made the window too big. Going back to the original example code, it too crashes when the window is too big (> 1000x1000 or so).

I narrowed down in the example that this line appears to be responsible:

pixmap = gdk_pixmap_new(window->window,500,500,-1);

Where pixmap is of type GdkPixmap*. Resizing the window overwrites pixmap with a new pixmap that is the size of the window.

I am doing this in Eclipse Juno in Windows Vista, 32-bit. My compiler is MinGW version 0.5-beta-20120426-1. My GTK+ version is 2.24.10 and apparently Cairo is 1.10.2 I added all of the includes and libraries for GTK and also added compiler switch -mms-bitfields.

Is there a limit to the size of a pixmap or something? I'm just starting with GTK with examples so I'm not sure where to go if this example doesn't work.

liberforce
  • 11,189
  • 37
  • 48

1 Answers1

1

Tried with GTK 2.24.10 and cairo 1.12.2 on Debian, it works (no crash), with a maximized window on a 1280x1024 display. However, I'm aware that there is a memory leak on GTK for Windows, which has been fixed since GTK 2.24.14. Is your crash happening soon, or after some more time ? If it's crashing soon, that's another problem, otherwise just give a look at the memory consumption.

Compiling GTK with debug symbols would also help to narrow down the bug...

BTW, is window->window valid at the time the crash happens?

liberforce
  • 11,189
  • 37
  • 48