[xiph-commits] r13166 - branches/lowmem-no-byte/Tremor

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Thu Jun 21 16:37:15 PDT 2007


Author: xiphmont
Date: 2007-06-21 16:37:15 -0700 (Thu, 21 Jun 2007)
New Revision: 13166

Modified:
   branches/lowmem-no-byte/Tremor/Makefile.am
   branches/lowmem-no-byte/Tremor/framing.c
   branches/lowmem-no-byte/Tremor/misc.h
Log:
 Eliminate memory leak bugs in Tremor-nobyte (closes bug 1127)
 Eliminate electric fence from debug Makefile; valgrind supercedes.



Modified: branches/lowmem-no-byte/Tremor/Makefile.am
===================================================================
--- branches/lowmem-no-byte/Tremor/Makefile.am	2007-06-21 23:18:01 UTC (rev 13165)
+++ branches/lowmem-no-byte/Tremor/Makefile.am	2007-06-21 23:37:15 UTC (rev 13166)
@@ -31,7 +31,7 @@
 	$(MAKE) ivorbisfile_example
 
 debug:
-	$(MAKE) all CFLAGS="@DEBUG@" LDFLAGS="-lefence"	
+	$(MAKE) all CFLAGS="@DEBUG@" 
 
 profile:
 	$(MAKE) all CFLAGS="@PROFILE@"

Modified: branches/lowmem-no-byte/Tremor/framing.c
===================================================================
--- branches/lowmem-no-byte/Tremor/framing.c	2007-06-21 23:18:01 UTC (rev 13165)
+++ branches/lowmem-no-byte/Tremor/framing.c	2007-06-21 23:37:15 UTC (rev 13166)
@@ -53,11 +53,6 @@
     bt=bs->unused_buffers;
     rt=bs->unused_references;
 
-    if(!bs->outstanding){
-      _ogg_free(bs);
-      return;
-    }
-
     while(bt){
       ogg_buffer *b=bt;
       bt=b->ptr.next;
@@ -71,6 +66,10 @@
       _ogg_free(r);
     }
     bs->unused_references=0;
+
+    if(!bs->outstanding)
+      _ogg_free(bs);
+
   }
 }
 
@@ -825,6 +824,7 @@
     ogg_buffer_release(os->header_tail);
     ogg_buffer_release(os->body_tail);
     memset(os,0,sizeof(*os));    
+    _ogg_free(os);
   }
   return OGG_SUCCESS;
 } 

Modified: branches/lowmem-no-byte/Tremor/misc.h
===================================================================
--- branches/lowmem-no-byte/Tremor/misc.h	2007-06-21 23:18:01 UTC (rev 13165)
+++ branches/lowmem-no-byte/Tremor/misc.h	2007-06-21 23:37:15 UTC (rev 13166)
@@ -20,8 +20,8 @@
 #include "ivorbiscodec.h"
 #include "os_types.h"
 
-#define _VDBG_GRAPHFILE "_0.m"
 
+/*#define _VDBG_GRAPHFILE "_0.m"*/
 
 #ifdef _VDBG_GRAPHFILE
 extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line); 



More information about the commits mailing list