mldonkey-commits
[Top][All Lists]
Advanced

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

[Mldonkey-commits] mldonkey distrib/ChangeLog src/utils/cdk/zlibst...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey distrib/ChangeLog src/utils/cdk/zlibst...
Date: Sat, 02 Jun 2007 14:51:44 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       07/06/02 14:51:44

Modified files:
        distrib        : ChangeLog 
        src/utils/cdk  : zlibstubs.c 

Log message:
        patch #5986

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1271&r2=1.1272
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/cdk/zlibstubs.c?cvsroot=mldonkey&r1=1.4&r2=1.5

Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1271
retrieving revision 1.1272
diff -u -b -r1.1271 -r1.1272
--- distrib/ChangeLog   1 Jun 2007 19:43:41 -0000       1.1271
+++ distrib/ChangeLog   2 Jun 2007 14:51:44 -0000       1.1272
@@ -14,6 +14,9 @@
 ChangeLog
 =========
 
+2007/06/02
+5986: Fix GC problem in bz2 code (pango)
+
 2007/06/01
 5891: Disconnect clients we download from when a file is queued/paused
 5905: Replace old DirectConnect module with new DC++ code (alffa)

Index: src/utils/cdk/zlibstubs.c
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/cdk/zlibstubs.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- src/utils/cdk/zlibstubs.c   20 Jul 2006 11:33:58 -0000      1.4
+++ src/utils/cdk/zlibstubs.c   2 Jun 2007 14:51:44 -0000       1.5
@@ -10,7 +10,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: zlibstubs.c,v 1.4 2006/07/20 11:33:58 spiralvoice Exp $ */
+/* $Id: zlibstubs.c,v 1.5 2007/06/02 14:51:44 spiralvoice Exp $ */
 
 /* Stub code to interface with Zlib */
 
@@ -57,14 +57,13 @@
 
 static value camlzip_new_stream(void)
 {
-  value res = alloc((sizeof(z_stream) + sizeof(value) - 1) / sizeof(value),
-                    Abstract_tag);
-  ZStream_val(res)->zalloc = NULL;
-  ZStream_val(res)->zfree = NULL;
-  ZStream_val(res)->opaque = NULL;
-  ZStream_val(res)->next_in = NULL;
-  ZStream_val(res)->next_out = NULL;
-  return res;
+  z_stream * zs = (z_stream *) malloc(sizeof(z_stream));
+  zs->zalloc = NULL;
+  zs->zfree = NULL;
+  zs->opaque = NULL;
+  zs->next_in = NULL;
+  zs->next_out = NULL;
+  return (value) zs;
 }
 
 value camlzip_deflateInit(value vlevel, value expect_header)
@@ -119,6 +118,7 @@
 {
   if (deflateEnd(ZStream_val(vzs)) != Z_OK)
     camlzip_error("Zlib.deflateEnd", vzs);
+  free(ZStream_val(vzs));
   return Val_unit;
 }
 
@@ -168,6 +168,7 @@
 {
   if (inflateEnd(ZStream_val(vzs)) != Z_OK)
     camlzip_error("Zlib.inflateEnd", vzs);
+  free(ZStream_val(vzs));
   return Val_unit;
 }
 
@@ -229,14 +230,13 @@
 
 static value camlzip_new_bzstream(void)
 {
-  value res = alloc((sizeof(bz_stream) + sizeof(value) - 1) / sizeof(value),
-                    Abstract_tag);
-  ZStream_val(res)->zalloc = NULL;
-  ZStream_val(res)->zfree = NULL;
-  ZStream_val(res)->opaque = NULL;
-  ZStream_val(res)->next_in = NULL;
-  ZStream_val(res)->next_out = NULL;
-  return res;
+  bz_stream * bzs = (bz_stream *) malloc(sizeof(bz_stream));
+  bzs->bzalloc = NULL;
+  bzs->bzfree = NULL;
+  bzs->opaque = NULL;
+  bzs->next_in = NULL;
+  bzs->next_out = NULL;
+  return (value) bzs;
 }
 
 int camlzip_action_table[] = { BZ_RUN, BZ_FLUSH, BZ_FINISH };
@@ -299,6 +299,7 @@
   int err;
   if ((err = BZ2_bzCompressEnd(BZStream_val(stream))) != BZ_OK)
     camlzip_bzerror("Bzlib.compress_end", err);
+  free(BZStream_val(stream));
 #else
   failwith("Bzip2 compression not supported");
 #endif
@@ -359,6 +360,7 @@
   int err;
   if ((err = BZ2_bzDecompressEnd(BZStream_val(stream))) != BZ_OK)
     camlzip_bzerror("Bzlib.decompressEnd", err);
+  free(BZStream_val(stream));
 #else
   failwith("Bzip2 compression not supported");
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]