From 010dc35e8a98ff5bb2d501abc3a25e7e10e3dfd1 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Tue, 28 Apr 1998 01:01:34 +0000 Subject: [PATCH] Wee!!! No more curves crash! (Hopefully ;) Watch for this kind of stuff in other dialog code. Widget event handlers get called before the data that they reference gets initialized. Move all that init code inside the dialog creation. -Matt --- ChangeLog | 6 ++++++ app/base/curves.c | 6 +++++- app/curves.c | 6 +++++- app/tools/curves.c | 6 +++++- app/tools/gimpcurvestool.c | 6 +++++- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ad7db22e7..ff06934f01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Apr 27 20:57:26 1998 EDT Matthew Wilson + + * app/curves: Initialize data that is referenced in event handlers + in the curves_new_dialog function. Be on the look out for this + kind of stuff in other dialogs. + Tue Apr 28 00:16:31 1998 Tim Janik * app/channels_dialog.c (channels_dialog_create): adjust the scrolled diff --git a/app/base/curves.c b/app/base/curves.c index 6a244953b4..f3eb7b1023 100644 --- a/app/base/curves.c +++ b/app/base/curves.c @@ -437,12 +437,16 @@ curves_new_dialog () GtkWidget *channel_hbox; GtkWidget *menu; GtkWidget *table; - int i; + int i, j; cd = g_malloc (sizeof (CurvesDialog)); cd->preview = TRUE; cd->curve_type = SMOOTH; cd->pixmap = NULL; + cd->channel = HISTOGRAM_VALUE; + for (i = 0; i < 5; i++) + for (j = 0; j < 256; j++) + cd->curve[i][j] = j; for (i = 0; i < 5; i++) channel_items [i].user_data = (gpointer) cd; diff --git a/app/curves.c b/app/curves.c index 6a244953b4..f3eb7b1023 100644 --- a/app/curves.c +++ b/app/curves.c @@ -437,12 +437,16 @@ curves_new_dialog () GtkWidget *channel_hbox; GtkWidget *menu; GtkWidget *table; - int i; + int i, j; cd = g_malloc (sizeof (CurvesDialog)); cd->preview = TRUE; cd->curve_type = SMOOTH; cd->pixmap = NULL; + cd->channel = HISTOGRAM_VALUE; + for (i = 0; i < 5; i++) + for (j = 0; j < 256; j++) + cd->curve[i][j] = j; for (i = 0; i < 5; i++) channel_items [i].user_data = (gpointer) cd; diff --git a/app/tools/curves.c b/app/tools/curves.c index 6a244953b4..f3eb7b1023 100644 --- a/app/tools/curves.c +++ b/app/tools/curves.c @@ -437,12 +437,16 @@ curves_new_dialog () GtkWidget *channel_hbox; GtkWidget *menu; GtkWidget *table; - int i; + int i, j; cd = g_malloc (sizeof (CurvesDialog)); cd->preview = TRUE; cd->curve_type = SMOOTH; cd->pixmap = NULL; + cd->channel = HISTOGRAM_VALUE; + for (i = 0; i < 5; i++) + for (j = 0; j < 256; j++) + cd->curve[i][j] = j; for (i = 0; i < 5; i++) channel_items [i].user_data = (gpointer) cd; diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c index 6a244953b4..f3eb7b1023 100644 --- a/app/tools/gimpcurvestool.c +++ b/app/tools/gimpcurvestool.c @@ -437,12 +437,16 @@ curves_new_dialog () GtkWidget *channel_hbox; GtkWidget *menu; GtkWidget *table; - int i; + int i, j; cd = g_malloc (sizeof (CurvesDialog)); cd->preview = TRUE; cd->curve_type = SMOOTH; cd->pixmap = NULL; + cd->channel = HISTOGRAM_VALUE; + for (i = 0; i < 5; i++) + for (j = 0; j < 256; j++) + cd->curve[i][j] = j; for (i = 0; i < 5; i++) channel_items [i].user_data = (gpointer) cd;