[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Linphone-developers] Possible memory leak in 2.99.3
From: |
mini core2 |
Subject: |
[Linphone-developers] Possible memory leak in 2.99.3 |
Date: |
Thu, 25 Sep 2008 04:04:49 +0000 |
Dear Sirs:
When I am using the mediastreamer in writing a soft videophone in WIN32
platform, I found 2 memory leaks in the mediastreamer. The original code of
"video_out_uninit" in "videoout.c" is
static void video_out_uninit(MSFilter *f){
VideoOut *obj=(VideoOut*)f->data;
if (obj->display!=NULL && obj->own_display)
ms_display_destroy(obj->display);
if (obj->sws1!=NULL){
sws_freeContext(obj->sws1);
obj->sws1=NULL;
}
if (obj->sws2!=NULL){
sws_freeContext(obj->sws2);
obj->sws2=NULL;
}
ms_free(obj);
}
And when I use it in the windows, I found the memory leak happened whenever I
make a call to linphone. And after debugging, the code seems to not free the
allocated memory of local_msg and tmp_local_msg. So I suggest to add the code
as in "video_out_preprocess" to "video_out_uninit"
static void video_out_uninit(MSFilter *f){
VideoOut *obj=(VideoOut*)f->data;
if (obj->display!=NULL && obj->own_display)
ms_display_destroy(obj->display);
if (obj->sws1!=NULL){
sws_freeContext(obj->sws1);
obj->sws1=NULL;
}
if (obj->sws2!=NULL){
sws_freeContext(obj->sws2);
obj->sws2=NULL;
}
/* minicore2, without this may have a memory leak after finish a video
call. */
if (obj->local_msg!=NULL) {
freemsg(obj->local_msg);
obj->local_msg=NULL;
}
if (obj->tmp_local_msg!=NULL) {
freemsg(obj->tmp_local_msg);
obj->tmp_local_msg=NULL;
}
ms_free(obj);
}
Sincerely,
/minicore2
_________________________________________________________________
5 GB 超大容量 、創新便捷、安全防護垃圾郵件和病毒 — 立即升級 Windows Live Hotmail
http://mail.live.com
- [Linphone-developers] Possible memory leak in 2.99.3,
mini core2 <=