aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-04-05 09:21:28 +0800
committerChris Lahey <clahey@src.gnome.org>2000-04-05 09:21:28 +0800
commit0d327d6fc33813fcc06ae52b10cb74c7b0421acd (patch)
treea7ce0e0329996a99abb140dd4b4f49197b2f4934 /addressbook
parentab9a56f51b6c836884eb1fd7d8864807e6c5ed40 (diff)
downloadgsoc2013-evolution-0d327d6fc33813fcc06ae52b10cb74c7b0421acd.tar.gz
gsoc2013-evolution-0d327d6fc33813fcc06ae52b10cb74c7b0421acd.tar.zst
gsoc2013-evolution-0d327d6fc33813fcc06ae52b10cb74c7b0421acd.zip
Fixed some referencing and lifetime issues.
2000-04-04 Christopher James Lahey <clahey@helixcode.com> * widgets/e-minicard/e-minicard.c: Fixed some referencing and lifetime issues. From widgets/e-table: 2000-04-04 Christopher James Lahey <clahey@helixcode.com> * e-table-text-model.c: Make this assert a bit more readable. * e-table-item.c: Fix update loop behavior. svn path=/trunk/; revision=2291
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/gui/minicard/e-minicard.c24
-rw-r--r--addressbook/gui/widgets/e-minicard.c24
2 files changed, 46 insertions, 2 deletions
diff --git a/addressbook/gui/minicard/e-minicard.c b/addressbook/gui/minicard/e-minicard.c
index b7b9a4c10e..2a98a574c7 100644
--- a/addressbook/gui/minicard/e-minicard.c
+++ b/addressbook/gui/minicard/e-minicard.c
@@ -32,6 +32,7 @@ static void e_minicard_init (EMinicard *card);
static void e_minicard_class_init (EMinicardClass *klass);
static void e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
static void e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_minicard_destroy (GtkObject *object);
static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event);
static void e_minicard_realize (GnomeCanvasItem *item);
static void e_minicard_unrealize (GnomeCanvasItem *item);
@@ -104,7 +105,7 @@ e_minicard_class_init (EMinicardClass *klass)
object_class->set_arg = e_minicard_set_arg;
object_class->get_arg = e_minicard_get_arg;
- /* object_class->destroy = e_minicard_destroy; */
+ object_class->destroy = e_minicard_destroy;
/* GnomeCanvasItem method overrides */
item_class->realize = e_minicard_realize;
@@ -168,7 +169,11 @@ e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
gnome_canvas_item_request_update (item);*/
break;
case ARG_MODEL:
+ if (e_minicard->model)
+ gtk_object_unref (e_minicard->model);
e_minicard->model = E_TABLE_MODEL(GTK_VALUE_OBJECT (*arg));
+ if (e_minicard->model)
+ gtk_object_ref (e_minicard->model);
remodel(e_minicard);
e_canvas_item_request_reflow(item);
break;
@@ -213,6 +218,23 @@ e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
}
static void
+e_minicard_destroy (GtkObject *object)
+{
+ EMinicard *e_minicard;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (E_IS_MINICARD (object));
+
+ e_minicard = E_MINICARD (object);
+
+ if (e_minicard->model)
+ gtk_object_unref (e_minicard->model);
+
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+}
+
+static void
e_minicard_realize (GnomeCanvasItem *item)
{
EMinicard *e_minicard;
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index b7b9a4c10e..2a98a574c7 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -32,6 +32,7 @@ static void e_minicard_init (EMinicard *card);
static void e_minicard_class_init (EMinicardClass *klass);
static void e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
static void e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_minicard_destroy (GtkObject *object);
static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event);
static void e_minicard_realize (GnomeCanvasItem *item);
static void e_minicard_unrealize (GnomeCanvasItem *item);
@@ -104,7 +105,7 @@ e_minicard_class_init (EMinicardClass *klass)
object_class->set_arg = e_minicard_set_arg;
object_class->get_arg = e_minicard_get_arg;
- /* object_class->destroy = e_minicard_destroy; */
+ object_class->destroy = e_minicard_destroy;
/* GnomeCanvasItem method overrides */
item_class->realize = e_minicard_realize;
@@ -168,7 +169,11 @@ e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
gnome_canvas_item_request_update (item);*/
break;
case ARG_MODEL:
+ if (e_minicard->model)
+ gtk_object_unref (e_minicard->model);
e_minicard->model = E_TABLE_MODEL(GTK_VALUE_OBJECT (*arg));
+ if (e_minicard->model)
+ gtk_object_ref (e_minicard->model);
remodel(e_minicard);
e_canvas_item_request_reflow(item);
break;
@@ -213,6 +218,23 @@ e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
}
static void
+e_minicard_destroy (GtkObject *object)
+{
+ EMinicard *e_minicard;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (E_IS_MINICARD (object));
+
+ e_minicard = E_MINICARD (object);
+
+ if (e_minicard->model)
+ gtk_object_unref (e_minicard->model);
+
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+}
+
+static void
e_minicard_realize (GnomeCanvasItem *item)
{
EMinicard *e_minicard;