Skip to content

Commit 931aa7a

Browse files
committed
Revert "Don't print out warnings when freeing."
1 parent 9050d89 commit 931aa7a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ext/zlib/zlib.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,17 @@ zstream_finalize(struct zstream *z)
12261226
finalizer_warn("the stream was freed prematurely.");
12271227
}
12281228

1229+
static void
1230+
zstream_free(void *p)
1231+
{
1232+
struct zstream *z = p;
1233+
1234+
if (ZSTREAM_IS_READY(z)) {
1235+
zstream_finalize(z);
1236+
}
1237+
xfree(z);
1238+
}
1239+
12291240
static size_t
12301241
zstream_memsize(const void *p)
12311242
{
@@ -1235,7 +1246,7 @@ zstream_memsize(const void *p)
12351246

12361247
static const rb_data_type_t zstream_data_type = {
12371248
"zstream",
1238-
{ zstream_mark, xfree, zstream_memsize, },
1249+
{ zstream_mark, zstream_free, zstream_memsize, },
12391250
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
12401251
};
12411252

0 commit comments

Comments
 (0)