Enlightenment CVS committal

Author  : xcomputerman
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_x


Modified Files:
        ecore_x_dnd.c 


Log Message:
Prevent possible multiple inits

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_dnd.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- ecore_x_dnd.c       27 Dec 2004 18:28:14 -0000      1.13
+++ ecore_x_dnd.c       27 Dec 2004 18:30:28 -0000      1.14
@@ -5,16 +5,22 @@
 
 static Ecore_X_Selection_Data _xdnd_selection;
 static Ecore_X_DND_Protocol *_xdnd = NULL;
+static int _ecore_x_dnd_init_count = 0;
 
 void
 _ecore_x_dnd_init (void)
 {
-   _xdnd = calloc(1, sizeof(Ecore_X_DND_Protocol));
+   if (!_ecore_x_dnd_init_count)
+   {
+      _xdnd = calloc(1, sizeof(Ecore_X_DND_Protocol));
    
-   _xdnd->version = ECORE_X_DND_VERSION;
-   _xdnd->source = None;
-   _xdnd->dest = None;
-   _xdnd->state = ECORE_X_DND_IDLE;
+      _xdnd->version = ECORE_X_DND_VERSION;
+      _xdnd->source = None;
+      _xdnd->dest = None;
+      _xdnd->state = ECORE_X_DND_IDLE;
+   }
+
+   _ecore_x_dnd_init_count++;
 
 }
 
@@ -24,6 +30,7 @@
    if(_xdnd)
       free(_xdnd);
    _xdnd = NULL;
+   _ecore_x_dnd_init_count = 0;
 }
 
 void




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to