Commit 20acd114 authored by Daiki Ueno's avatar Daiki Ueno

Don't use floating object for EekElement.

parent b36e2f09
......@@ -200,7 +200,7 @@ eek_clutter_key_set_property (GObject *object,
switch (prop_id) {
case PROP_KEY:
priv->key = g_value_get_object (value);
g_object_ref_sink (priv->key);
g_object_ref (priv->key);
break;
case PROP_RENDERER:
priv->renderer = g_value_get_object (value);
......@@ -224,7 +224,7 @@ eek_clutter_key_dispose (GObject *object)
priv->renderer = NULL;
}
if (priv->key && g_object_is_floating (priv->key)) {
if (priv->key) {
g_object_unref (priv->key);
priv->key = NULL;
}
......
......@@ -166,7 +166,7 @@ eek_clutter_keyboard_set_property (GObject *object,
switch (prop_id) {
case PROP_KEYBOARD:
priv->keyboard = g_value_get_object (value);
g_object_ref_sink (priv->keyboard);
g_object_ref (priv->keyboard);
create_renderer (EEK_CLUTTER_KEYBOARD(object));
break;
default:
......@@ -187,7 +187,7 @@ eek_clutter_keyboard_dispose (GObject *object)
priv->renderer = NULL;
}
if (priv->keyboard && g_object_is_floating (priv->keyboard)) {
if (priv->keyboard) {
g_object_unref (priv->keyboard);
priv->keyboard = NULL;
}
......
......@@ -140,7 +140,7 @@ eek_clutter_section_set_property (GObject *object,
switch (prop_id) {
case PROP_SECTION:
priv->section = g_value_get_object (value);
g_object_ref_sink (priv->section);
g_object_ref (priv->section);
break;
case PROP_RENDERER:
priv->renderer = g_value_get_object (value);
......@@ -164,7 +164,7 @@ eek_clutter_section_dispose (GObject *object)
priv->renderer = NULL;
}
if (priv->section && g_object_is_floating (priv->section)) {
if (priv->section) {
g_object_unref (priv->section);
priv->section = NULL;
}
......
......@@ -58,7 +58,7 @@ eek_container_real_add_child (EekContainer *self,
EekContainerPrivate *priv = EEK_CONTAINER_GET_PRIVATE(self);
g_return_if_fail (EEK_IS_ELEMENT(child));
g_object_ref_sink (child);
g_object_ref (child);
priv->children = g_slist_prepend (priv->children, child);
eek_element_set_parent (child, EEK_ELEMENT(self));
......
......@@ -42,7 +42,7 @@ enum {
PROP_LAST
};
G_DEFINE_ABSTRACT_TYPE (EekElement, eek_element, G_TYPE_INITIALLY_UNOWNED);
G_DEFINE_ABSTRACT_TYPE (EekElement, eek_element, G_TYPE_OBJECT);
#define EEK_ELEMENT_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), EEK_TYPE_ELEMENT, EekElementPrivate))
......@@ -68,7 +68,7 @@ eek_element_real_set_parent (EekElement *self,
priv->parent = NULL;
} else {
g_return_if_fail (!priv->parent);
g_object_ref_sink (self);
g_object_ref (self);
priv->parent = parent;
}
}
......
......@@ -37,7 +37,7 @@ typedef struct _EekElementPrivate EekElementPrivate;
struct _EekElement
{
/*< private >*/
GInitiallyUnowned parent;
GObject parent;
EekElementPrivate *priv;
};
......@@ -45,7 +45,7 @@ struct _EekElement
struct _EekElementClass
{
/*< private >*/
GInitiallyUnownedClass parent_class;
GObjectClass parent_class;
void (* set_parent) (EekElement *self,
EekElement *parent);
EekElement *(* get_parent) (EekElement *self);
......
......@@ -204,7 +204,7 @@ eek_gtk_keyboard_set_keyboard (EekGtkKeyboard *self,
EekKeyboard *keyboard)
{
EekGtkKeyboardPrivate *priv = EEK_GTK_KEYBOARD_GET_PRIVATE(self);
priv->keyboard = g_object_ref_sink (keyboard);
priv->keyboard = g_object_ref (keyboard);
g_signal_connect (priv->keyboard, "key-pressed",
G_CALLBACK(on_key_pressed), self);
......@@ -245,7 +245,7 @@ eek_gtk_keyboard_dispose (GObject *object)
priv->renderer = NULL;
}
if (priv->keyboard && g_object_is_floating (priv->keyboard)) {
if (priv->keyboard) {
g_object_unref (priv->keyboard);
priv->keyboard = NULL;
}
......
......@@ -534,7 +534,8 @@ eek_renderer_set_property (GObject *object,
switch (prop_id) {
case PROP_KEYBOARD:
priv->keyboard = g_value_get_object (value);
g_object_ref_sink (priv->keyboard);
g_object_ref (priv->keyboard);
g_signal_connect (priv->keyboard, "keysym-index-changed",
G_CALLBACK(on_keysym_index_changed),
object);
......@@ -552,8 +553,7 @@ eek_renderer_dispose (GObject *object)
EekRendererPrivate *priv = EEK_RENDERER_GET_PRIVATE(object);
if (priv->keyboard) {
if (g_object_is_floating (priv->keyboard))
g_object_unref (priv->keyboard);
g_object_unref (priv->keyboard);
priv->keyboard = NULL;
}
if (priv->pcontext) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment