soylent r159 - trunk/libsoylent
- From: svenp svn gnome org
- To: svn-commits-list gnome org
- Subject: soylent r159 - trunk/libsoylent
- Date: Sat, 14 Jun 2008 14:34:00 +0000 (UTC)
Author: svenp
Date: Sat Jun 14 14:34:00 2008
New Revision: 159
URL: http://svn.gnome.org/viewvc/soylent?rev=159&view=rev
Log:
implemented SlEntity dispose
Modified:
trunk/libsoylent/soylent-entity.c
trunk/libsoylent/soylent-entity.h
Modified: trunk/libsoylent/soylent-entity.c
==============================================================================
--- trunk/libsoylent/soylent-entity.c (original)
+++ trunk/libsoylent/soylent-entity.c Sat Jun 14 14:34:00 2008
@@ -13,7 +13,6 @@
static void _soylent_entity_class_init(gpointer g_class, gpointer class_data);
static void _soylent_entity_init(GTypeInstance *instance, gpointer g_class);
static void _soylent_entity_dispose(GObject *object);
-static void _soylent_entity_finalize(GObject *object);
static void _soylent_entity_set_property(GObject *object, guint property_id,
const GValue *value, GParamSpec *pspec);
static void _soylent_entity_get_property(GObject *object, guint property_id,
@@ -45,7 +44,6 @@
g_assert(parent_class != NULL);
parent_class->dispose = _soylent_entity_dispose;
- parent_class->finalize = _soylent_entity_finalize;
parent_class->set_property = _soylent_entity_set_property;
parent_class->get_property = _soylent_entity_get_property;
}
@@ -55,14 +53,17 @@
SoylentEntityPriv *priv = g_new(SoylentEntityPriv, 1);
self->priv = priv;
self->priv->foo = "FOO";
+ self->disposed = FALSE;
}
static void _soylent_entity_dispose(GObject *object) {
- g_warning("%s not implemented", __FUNCTION__);
-}
-
-static void _soylent_entity_finalize(GObject *object) {
- g_warning("%s not implemented", __FUNCTION__);
+ SoylentEntity *self = SOYLENT_ENTITY(object);
+ g_return_if_fail(!self->disposed);
+
+ g_free(self->priv);
+ self->disposed = TRUE;
+
+ parent_class->dispose (object);
}
static void _soylent_entity_set_property(GObject *object, guint property_id,
@@ -82,4 +83,9 @@
gpointer soylent_entity_get(SoylentEntity *self, const gchar *attrname) {
return self->priv->foo;
+
+ /*
+ 1) get from cache
+ 2) if not present: get from source
+ */
}
Modified: trunk/libsoylent/soylent-entity.h
==============================================================================
--- trunk/libsoylent/soylent-entity.h (original)
+++ trunk/libsoylent/soylent-entity.h Sat Jun 14 14:34:00 2008
@@ -24,6 +24,7 @@
struct _SoylentEntity {
GObject parent;
+ gboolean disposed;
SoylentEntityPriv *priv;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]