[gtk-mac-integration] Remove gtkosx_application_cleanup



commit 61397f4669eccde7ee827dae8a57d54097d6265c
Author: John Ralls <jralls ceridwen us>
Date:   Tue Feb 14 21:03:53 2012 -0800

    Remove gtkosx_application_cleanup
    
    
    In favor of doing it the right way with gtkosx_application_dispose.

 src/GtkApplicationNotify.c     |    1 -
 src/gtkosxapplication_quartz.c |   29 +++++++++++------------------
 src/gtkosxapplicationprivate.h |    4 ++--
 3 files changed, 13 insertions(+), 21 deletions(-)
---
diff --git a/src/GtkApplicationNotify.c b/src/GtkApplicationNotify.c
index f7cf0f8..fbae00b 100644
--- a/src/GtkApplicationNotify.c
+++ b/src/GtkApplicationNotify.c
@@ -75,7 +75,6 @@
 			      GTKOSX_TYPE_APPLICATION);
   if (sig)
       g_signal_emit(app, sig, 0);
-  gtkosx_application_cleanup(app);
   g_object_unref(app);
 
 }
diff --git a/src/gtkosxapplication_quartz.c b/src/gtkosxapplication_quartz.c
index b4394d9..7d1050e 100644
--- a/src/gtkosxapplication_quartz.c
+++ b/src/gtkosxapplication_quartz.c
@@ -470,13 +470,22 @@ gtkosx_application_init (GtkosxApplication *self)
 {
   [NSApplication sharedApplication];
   self->priv = GTKOSX_APPLICATION_GET_PRIVATE (self);
-  self->priv->pool = [[NSAutoreleasePool alloc] init];
   self->priv->use_quartz_accelerators = TRUE;
   self->priv->dock_menu = NULL;
   gdk_window_add_filter (NULL, global_event_filter_func, (gpointer)self);
   self->priv->notify = [[GtkApplicationNotificationObject alloc] init];
-  [self->priv->notify retain];
   [ NSApp setDelegate: [GtkApplicationDelegate new]];
+  self->priv->delegate = [NSApp delegate];
+}
+
+static void
+gtkosx_application_dispose (GObject *obj)
+{
+  GtkosxApplication *self = GTKOSX_APPLICATION (obj);
+  [self->priv->dock_menu release];
+  [self->priv->notify release];
+  [self->priv->delegate release];
+  G_OBJECT_CLASS(gtkosx_application_parent_class)->dispose (obj);
 }
 
 /**
@@ -600,22 +609,6 @@ gtkosx_application_ready (GtkosxApplication *self)
   [ NSApp finishLaunching ];
 }
 
-/**
- * gtkosx_application_cleanup:
- * @self: The GtkApplication object
- *
- * Destroy the GtkosxApplication object. Not normally needed, as the
- * object is expected to remain until the application quits, and this
- * function is called by the notification object at that time.  Menu
- * bars are released as the corresponding GtkMenuBars are destroyed.
- */
-void
-gtkosx_application_cleanup(GtkosxApplication *self)
-{
-  [self->priv->dock_menu release];
-  [self->priv->notify release];
-}
-
 /*
  * window_focus_cb:
  * @window: The application window receiving focus
diff --git a/src/gtkosxapplicationprivate.h b/src/gtkosxapplicationprivate.h
index 6c60c19..bf9cf25 100644
--- a/src/gtkosxapplicationprivate.h
+++ b/src/gtkosxapplicationprivate.h
@@ -27,16 +27,16 @@
 
 #include "gtkosxapplication.h"
 #import "GtkApplicationNotify.h"
+#import "GtkApplicationDelegate.h"
 
 #define  GTKOSX_APPLICATION_GET_PRIVATE(obj)	(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTKOSX_TYPE_APPLICATION, GtkosxApplicationPrivate))
 
 struct _GtkosxApplicationPrivate
 {
-  NSAutoreleasePool *pool;
   gboolean use_quartz_accelerators;
   NSMenu *dock_menu;
   GtkApplicationNotificationObject *notify;
-
+  GtkApplicationDelegate *delegate;
 };
 
 #endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]