[Gtk1-win-developers] Progress - decloaked GDK pointers
Brought to you by:
robinrowe
|
From: Robin R. <ro...@Mo...> - 2004-03-04 07:09:52
|
Hi. Hadn't found time to touch GTK1 for a couple months. Been busy on other things. My attempt to use GDK2 with GTK1 didn't work out. Am back working on GDK1. That has serious problems with releasing HDC handles with live resources in them, causing random crashes inside Windows. Same problem we've known about since last year. That GDK by design casts objects all over the place defeats debugging. This pointer cloaking had me a bit discouraged. Changed GTK1 this week to have all the by-design GTK pointer cloaking turned off so I can see clearly now what is going on. What that means is that GdkWhatever, GdkWhateverPrivate, and GdkWhateverPrivateWin32 are all the same struct type now. In making that change I discovered one place where an up-cast was converting to a type larger than had been allocated in memory. One bug fixed. Testing with HelloGtk, my new decloaked GDK1 immediately hurled on g_free, which puzzled me a bit. Rewrote the basic g_... glib memory handlers to streamline them, but it still crashed. Then I realized that for Windows apps and dlls there are separate heaps, that you have to keep malloc/free calls symmetric to the caller's address space. In other words, no calling local free on a pointer malloc-ed inside a dll. Inadvertently, a header file macro was doing that. Making all g_... memory functions exported dll functions fixed it. Am encouraged that I seem to be back on the right track and can see what's going on while crawling around in the VC++ debugger and BoundsChecker. Looks like quite a few repairs ahead, but making progress. After the GTK1 HDC bugs are fixed I would like to work on tablet support and a new macro recorder feature. Been wanting to work on both of those a long time. Cheers, Robin ------------------------------------------------------------------- Rob...@Mo... Hollywood, California www.CinePaint.org Open source digital motion picture film software |