discomfitor pushed a commit to branch master.

commit 046aecdf068aad48f65a857dde371f3282388a6b
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri May 3 13:29:25 2013 +0100

    fix invalid read of notification popup after delete
---
 src/modules/notification/e_mod_popup.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/modules/notification/e_mod_popup.c 
b/src/modules/notification/e_mod_popup.c
index 9a77a91..b78edd2 100644
--- a/src/modules/notification/e_mod_popup.c
+++ b/src/modules/notification/e_mod_popup.c
@@ -178,6 +178,14 @@ _notification_popup_place_coords_get(int zw, int zh, int 
ow, int oh, int pos, in
      }
 }
 
+static void
+_notification_popup_del_cb(void *obj)
+{
+   Popup_Data *popup = e_object_data_get(obj);
+
+   popup->win = NULL;
+}
+
 static Popup_Data *
 _notification_popup_new(E_Notification_Notify *n, unsigned id)
 {
@@ -219,6 +227,8 @@ _notification_popup_new(E_Notification_Notify *n, unsigned 
id)
    popup->id = id;
    /* Create the popup window */
    popup->win = e_popup_new(zone, 0, 0, 0, 0);
+   E_OBJECT_DEL_SET(popup->win, _notification_popup_del_cb);
+   e_object_data_set(E_OBJECT(popup->win), popup);
    e_popup_name_set(popup->win, "_e_popup_notification");
    popup->e = popup->win->evas;
 
@@ -283,6 +293,7 @@ _notification_popup_place(Popup_Data *popup,
    Eina_List *l;
    Evas_Object *o;
 
+   if (!popup->win) return pos;
    _notification_popup_place_coords_get(popup->win->zone->w, 
popup->win->zone->h, popup->win->w, popup->win->h, pos, &x, &y);
    e_popup_move(popup->win, x, y);
    EINA_LIST_FOREACH(popup->mirrors, l, o)
@@ -494,7 +505,7 @@ _notification_popdown(Popup_Data                  *popup,
 {
    E_FREE_FUNC(popup->timer, ecore_timer_del);
    popup->mirrors = eina_list_free(popup->mirrors);
-   e_object_del(E_OBJECT(popup->win));
+   if (popup->win) e_object_del(E_OBJECT(popup->win));
    if (popup->notif)
      {
         e_notification_notify_close(popup->notif, reason);

-- 

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2

Reply via email to