Permalink
Browse files

plotwindow fix

  • Loading branch information...
jcupitt committed Jun 5, 2010
1 parent 7cad4a3 commit 628fec1e6bac2dbe43c269ab24c390443579a5e1
Showing with 46 additions and 11 deletions.
  1. +1 −0 ChangeLog
  2. +2 −1 TODO
  3. +2 −2 src/main.c
  4. +1 −1 src/plot.c
  5. +36 −4 src/plotmodel.c
  6. +1 −0 src/plotmodel.h
  7. +1 −1 src/plotpresent.c
  8. +1 −1 src/plotview.c
  9. +1 −1 src/plotwindow.c
View
@@ -1,6 +1,7 @@
started 7.22.0, 12/5/10
- version bump
- gtksheet sizing changes, again
+- plot window destroy cleanup
started 7.21.0, 8/12/09
- 7.16 ws load could fail (thanks Jim)
View
3 TODO
@@ -3,7 +3,8 @@
that way we can have multiple versions installed, with multiple uninstallers
-- fix i18n startup, test for German VIPS
+
+
WONTFIX for 7.20
================
View
@@ -43,14 +43,14 @@
/* Stop on any gtk error/warning/whatever. Usually set by configure for dev
* builds.
-#define DEBUG_FATAL
*/
+#define DEBUG_FATAL
/* But some themes can trigger warnings, argh, so sometimes we need to
* undef it. VipsObject sets can trigger warnings. libgoffice will warn about
* precision issues if run under valgrind.
- */
#undef DEBUG_FATAL
+ */
/* Time startup.
#define DEBUG_TIME
View
@@ -28,8 +28,8 @@
*/
/*
-#define DEBUG
*/
+#define DEBUG
#include "ip.h"
View
@@ -28,25 +28,44 @@
*/
/*
-#define DEBUG
*/
+#define DEBUG
#include "ip.h"
static iObjectClass *parent_class = NULL;
static void
-plotmodel_finalize( GObject *gobject )
+plotmodel_dispose( GObject *gobject )
{
- Plotmodel *plotmodel = PLOTMODEL( gobject );
+ Plotmodel *plotmodel;
+
+ g_return_if_fail( gobject != NULL );
+ g_return_if_fail( IS_PLOTMODEL( gobject ) );
+
+ plotmodel = PLOTMODEL( gobject );
#ifdef DEBUG
- printf( "plotmodel_finalize: %p\n", plotmodel );
+ printf( "plotmodel_dispose %p: ", plotmodel );
+ iobject_print( IOBJECT( plotmodel ) );
#endif /*DEBUG*/
/* My instance destroy stuff.
*/
FREESID( plotmodel->changed_sid, plotmodel->plot );
+ FREESID( plotmodel->destroy_sid, plotmodel->plot );
+
+ G_OBJECT_CLASS( parent_class )->dispose( gobject );
+}
+
+static void
+plotmodel_finalize( GObject *gobject )
+{
+ Plotmodel *plotmodel = PLOTMODEL( gobject );
+
+#ifdef DEBUG
+ printf( "plotmodel_finalize: %p\n", plotmodel );
+#endif /*DEBUG*/
G_OBJECT_CLASS( parent_class )->finalize( gobject );
}
@@ -74,6 +93,7 @@ plotmodel_class_init( PlotmodelClass *class )
parent_class = g_type_class_peek_parent( class );
+ gobject_class->dispose = plotmodel_dispose;
gobject_class->finalize = plotmodel_finalize;
iobject_class->changed = plotmodel_changed;
@@ -93,6 +113,7 @@ plotmodel_init( Plotmodel *plotmodel )
#endif /*DEBUG*/
plotmodel->changed_sid = 0;
+ plotmodel->destroy_sid = 0;
plotmodel->width = -1;
plotmodel->height = -1;
plotmodel->mag = 100;
@@ -124,6 +145,14 @@ plotmodel_get_type( void )
return( type );
}
+static void
+plotmodel_plot_destroy_cb( Plot *plot, Plotmodel *plotmodel )
+{
+ plotmodel->plot = NULL;
+ plotmodel->destroy_sid = 0;
+ plotmodel->changed_sid = 0;
+}
+
static void
plotmodel_plot_changed_cb( Plot *plot, Plotmodel *plotmodel )
{
@@ -137,6 +166,9 @@ plotmodel_link( Plotmodel *plotmodel, Plot *plot )
* that.
*/
plotmodel->plot = plot;
+ plotmodel->destroy_sid = g_signal_connect(
+ G_OBJECT( plot ), "destroy",
+ G_CALLBACK( plotmodel_plot_destroy_cb ), plotmodel );
plotmodel->changed_sid = g_signal_connect(
G_OBJECT( plot ), "changed",
G_CALLBACK( plotmodel_plot_changed_cb ), plotmodel );
View
@@ -43,6 +43,7 @@ struct _Plotmodel {
*/
Plot *plot;
guint changed_sid;
+ guint destroy_sid;
/* The last canvas size we set ... stop resize loops with these.
*/
View
@@ -28,9 +28,9 @@
*/
/*
-#define DEBUG
#define DEBUG_EVENT
*/
+#define DEBUG
#include "ip.h"
View
@@ -28,9 +28,9 @@
*/
/*
-#define DEBUG
#define DEBUG_GEO
*/
+#define DEBUG
#include "ip.h"
View
@@ -1,4 +1,4 @@
-/* a gtkplot in a floating window
+/* a plotpresent / plotmodel in a floating window
*/
/*

0 comments on commit 628fec1

Please sign in to comment.