Plug memory leak
authorxcomputerman <xcomputerman>
Mon, 27 Dec 2004 18:28:14 +0000 (18:28 +0000)
committerxcomputerman <xcomputerman@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 27 Dec 2004 18:28:14 +0000 (18:28 +0000)
SVN revision: 12606

legacy/ecore/src/lib/ecore_x/ecore_x.c
legacy/ecore/src/lib/ecore_x/ecore_x_dnd.c
legacy/ecore/src/lib/ecore_x/ecore_x_private.h

index 9caa923..5185d3a 100644 (file)
@@ -381,6 +381,7 @@ _ecore_x_shutdown(int close_display)
    _ecore_x_disp = NULL;
    _ecore_x_event_handlers = NULL;
    _ecore_x_selection_shutdown();
+   _ecore_x_dnd_shutdown();
    if (_ecore_x_init_count < 0) _ecore_x_init_count = 0;
    return _ecore_x_init_count;
 }
index cebd034..c3ea5d9 100644 (file)
@@ -4,7 +4,7 @@
 #include "Ecore_X_Atoms.h"
 
 static Ecore_X_Selection_Data _xdnd_selection;
-static Ecore_X_DND_Protocol *_xdnd;
+static Ecore_X_DND_Protocol *_xdnd = NULL;
 
 void
 _ecore_x_dnd_init (void)
@@ -15,6 +15,15 @@ _ecore_x_dnd_init (void)
    _xdnd->source = None;
    _xdnd->dest = None;
    _xdnd->state = ECORE_X_DND_IDLE;
+
+}
+
+void
+_ecore_x_dnd_shutdown(void)
+{
+   if(_xdnd)
+      free(_xdnd);
+   _xdnd = NULL;
 }
 
 void
index 976c14d..59131b2 100644 (file)
@@ -163,5 +163,6 @@ int  _ecore_x_selection_convert(Atom selection, Atom target, void **data_ret);
 void _ecore_x_dnd_init(void);
 Ecore_X_DND_Protocol * _ecore_x_dnd_protocol_get(void);
 void _ecore_x_dnd_drag(int x, int y);
+void _ecore_x_dnd_shutdown(void);
 
 #endif