summaryrefslogtreecommitdiff
path: root/glib/gmem.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2004-10-04 20:19:30 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-10-04 20:19:30 +0000
commit8dc560a73999290b557893cf3d3eb1687983e021 (patch)
tree15b1d8c0c026a93aef69b0e673f1b3081c192d94 /glib/gmem.c
parent6c751a8924f16fd434138aa44e2f96fc26562d4c (diff)
downloadglib-8dc560a73999290b557893cf3d3eb1687983e021.tar.gz
Only set vtable_set if the vtable is set.
Diffstat (limited to 'glib/gmem.c')
-rw-r--r--glib/gmem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/glib/gmem.c b/glib/gmem.c
index d114927aa..0a07be463 100644
--- a/glib/gmem.c
+++ b/glib/gmem.c
@@ -248,7 +248,6 @@ g_mem_set_vtable (GMemVTable *vtable)
{
if (!vtable_set)
{
- vtable_set = TRUE;
if (vtable->malloc && vtable->realloc && vtable->free)
{
glib_mem_vtable.malloc = vtable->malloc;
@@ -257,6 +256,7 @@ g_mem_set_vtable (GMemVTable *vtable)
glib_mem_vtable.calloc = vtable->calloc ? vtable->calloc : fallback_calloc;
glib_mem_vtable.try_malloc = vtable->try_malloc ? vtable->try_malloc : glib_mem_vtable.malloc;
glib_mem_vtable.try_realloc = vtable->try_realloc ? vtable->try_realloc : glib_mem_vtable.realloc;
+ vtable_set = TRUE;
}
else
g_warning (G_STRLOC ": memory allocation vtable lacks one of malloc(), realloc() or free()");