#3 memory leak in iaxwrapper

closed
nobody
None
5
2006-02-09
2005-06-05
joost witteveen
No

As seen in
http://doc.trolltech.com/3.3/qapplication.html#postEvent
the second argument of

QApplication::postEvent ( QObject * receiver, QEvent *
event )

that is the event argument, has to be on the heap, as
it will be freed by Qt. However, in iaxc_callback(),
the wrapperEvent is also new-ed, but never freed.

The following patch seems to correct this (and it
solves the memory leak I've been getting, and as far as
I can see, I still get the same functionality).

--- tmp/kiax-0.8.4/src/iaxwrapper.cpp 2005-04-11
12:36:24.000000000 +0200
+++ cvs1/kiax-0.8.4/src/iaxwrapper.cpp 2005-06-06
00:41:14.000000000 +0200
@@ -477,6 +477,7 @@
IaxWrapperEvent * wev = (IaxWrapperEvent
*)event->data();
iaxc_event e = wev->iaxClientEvent;
handleIaxCEvent(e);
+ delete(wev);
}

Discussion

  • patch

     
    Attachments
    p
  • Emo
    Emo
    2006-02-09

    • status: open --> closed