Call the correct gadget method on gc_shutdonw
If this was a popup-on-desktop instance call the popup_destroyed() method instead of the instance_destroyed() one
This commit is contained in:
parent
192fa721fd
commit
518dd74474
|
@ -609,16 +609,28 @@ static void
|
||||||
_edgar_gc_shutdown(E_Gadcon_Client *gcc)
|
_edgar_gc_shutdown(E_Gadcon_Client *gcc)
|
||||||
{
|
{
|
||||||
Edgar_Py_Gadget *gadget = gcc->data;
|
Edgar_Py_Gadget *gadget = gcc->data;
|
||||||
|
PyObject *pyobj, *ret;
|
||||||
|
|
||||||
DBG("EDGAR: Gadcon Shutdown. NAME: %s, ID: %d", gcc->name, gcc->id);
|
DBG("EDGAR: Gadcon Shutdown. NAME: %s, ID: %d", gcc->name, gcc->id);
|
||||||
|
|
||||||
// call the instance_destroyed() method of the gadget.
|
pyobj = object_from_instance(gcc->o_base);
|
||||||
PyObject *py_obj = object_from_instance(gcc->o_base);
|
if (gcc->gadcon->location->site == E_GADCON_SITE_DESKTOP &&
|
||||||
PyObject *ret = PyObject_CallMethod(gadget->instance, "instance_destroyed",
|
gadget->opt_pop_on_desk)
|
||||||
"(S)", py_obj);
|
{
|
||||||
PY_ON_ERROR_RETURN(!ret, , "Cannot call instance_destroyed()");
|
// call the popup_destroyed() method of the gadget.
|
||||||
Py_DECREF(py_obj);
|
ret = PyObject_CallMethod(gadget->instance, "popup_destroyed",
|
||||||
Py_DECREF(ret);
|
"(S)", pyobj);
|
||||||
|
PY_ON_ERROR_RETURN(!ret, , "Cannot call popup_destroyed()");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// call the instance_destroyed() method of the gadget.
|
||||||
|
ret = PyObject_CallMethod(gadget->instance, "instance_destroyed",
|
||||||
|
"(S)", pyobj);
|
||||||
|
PY_ON_ERROR_RETURN(!ret, , "Cannot call instance_destroyed()");
|
||||||
|
}
|
||||||
|
Py_XDECREF(ret);
|
||||||
|
Py_XDECREF(pyobj);
|
||||||
|
|
||||||
// destroy the object
|
// destroy the object
|
||||||
evas_object_del(gcc->o_base);
|
evas_object_del(gcc->o_base);
|
||||||
|
|
Loading…
Reference in New Issue