Suggested by vtorri.
SVN revision: 70418
* @brief Create a new weak reference to obj.
* @param obj The object being referenced.
* @param wref The pointer to use for the weak ref.
+ * @return The object being referenced (obj).
*/
-EAPI void eobj_weak_ref_add(const Eobj *obj, Eobj **wref);
+EAPI Eobj *eobj_weak_ref_add(const Eobj *obj, Eobj **wref);
/**
* @brief Free the weak reference passed.
return EOBJ_CALLBACK_CONTINUE;
}
-EAPI void
+EAPI Eobj *
eobj_weak_ref_add(const Eobj *_obj, Eobj **wref)
{
Eobj *obj = (Eobj *) _obj;
- EOBJ_MAGIC_RETURN(obj, EOBJ_EINA_MAGIC);
+ EOBJ_MAGIC_RETURN_VAL(obj, EOBJ_EINA_MAGIC, obj);
*wref = obj;
eobj_event_callback_add(obj, EOBJ_EV_DEL, _eobj_weak_ref_cb, wref);
+
+ return obj;
}
EAPI void