[Thread Prev][Thread Next]   >Date Index >Thread Index

Re: [wmx] The patch to fix mysterious crashes and disappearing fonts in root menus

Stefan `Sec` Zehl - Sun May 16 01:07:54 1999

On Sun, May 16, 1999 at 01:25:12AM +0300, Lasse Rasinen wrote:
> Stefan `Sec` Zehl <sec@42.org> writes:
> > While investigationg your option, i don't see how it leaks memory ? It
> > doesn't free it, but then it doesn't re-allocate it either ?
> 
> Well, no, it doesn't reallocate it. My definition of memory leak may be
> different, then. 
> 
> It does reallocate it if you restart wmx over and over again, but that's
> not really normal behaviour.

Okay, thats something i can live with. (If somebody else can't, your
invited to send in a complete fix :-)

Btw.: What do you think? Should the mouse be warped to the window if you
select it from the 'window' menu, even if the selection was done with
the mouse ?

CU,
    Sec
-- 
        Since compiler users outnumber compiler writers 1000:1, if it's
        possible to save a compiler user 1 hour, it's worth 1000 hours
        of the compiler writer's time.
Index: Border.C
===================================================================
RCS file: /home/sec/.cvstree/repository/wmx/Border.C,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Border.C	1999/05/15 22:49:03	1.8
+++ Border.C	1999/05/15 23:00:04	1.9
@@ -23,9 +23,7 @@
 unsigned long Border::m_borderPixel;
 Pixmap Border::m_backgroundPixmap = None;
 
-static int borderCounter = 0;
 
-
 class BorderRectangle // must resemble XRectangle in storage
 {
 public:
@@ -70,7 +68,6 @@
 {
     m_parent = root();
     if (m_tabFont == 0) initialiseStatics(c->windowManager());
-    ++borderCounter;
 
 //#if CONFIG_MAD_FEEDBACK != 0
     m_feedback = 0;
@@ -94,14 +91,6 @@
     }
 
     if (m_label) free(m_label);
-
-    if (--borderCounter == 0) {
-	XFreeGC(display(), m_drawGC);
-	m_drawGC = 0;
-	if (m_backgroundPixmap != None) {
-	    XFreePixmap(display(), m_backgroundPixmap);
-	}
-    }
 }
 
 

Next: