On Tue, Mar 16, 2004 at 09:19:34PM +0000, bulia byak wrote:
in align.cpp and transformation.cpp, in delete signal handlers, you wrote
static gboolean sp_transformation_dialog_delete(GtkObject *, GdkEvent *, gpointer data) { if ( data != static_cast<gpointer>(dlg) ) { g_warning("possible bug: dlg differs from passed data"); /* E.g. maybe we shouldn't update the global x,y,w,h, or maybe we should use dlg instead of dead_dlg below. */ } GtkWindow &dead_dlg = *static_cast<GtkWindow *>(data); gtk_window_get_position(&dead_dlg, &x, &y); gtk_window_get_size(&dead_dlg, &w, &h);
instead of the previous code which simply used dlg, ignoring data. I don't quite understand the reason for this change.
Something is very strange here. Consider the align.cpp case, which is slightly simpler. According to gdb, we call
g_signal_connect(..., sp_align_dialog_delete, dlg)
with dlg == 0x087aaf10.
However, sp_align_dialog_delete gets called with data == 0xbfffe860. (dlg remains at 0x087aaf10.)
Where can this value of `data' be coming from? sp_align_dialog_delete is a static function, passed only to gtk_signal_connect and g_signal_connect, each using dlg==0x087aaf10 as the callback data value.
I haven't tried compiling glib with -g, but at the moment it seems that data corruption is occurring.
Changing back to use dlg rather than the passed data should be safe, though perhaps we should take this as a hint that we should pay more attention to valgrind etc. warnings.
Can someone else have a look and confirm my analysis? I'm not so familiar with glib/gtk signals, perhaps I've missed something simple.
pjrm.