aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--generic/tkZinc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/generic/tkZinc.c b/generic/tkZinc.c
index da858a2..8f2bd99 100644
--- a/generic/tkZinc.c
+++ b/generic/tkZinc.c
@@ -447,6 +447,10 @@ ZnBitmapParse(ClientData client_data,
}
*image_ptr = image;
}
+ else if (prev_image != NULL) {
+ ZnFreeImage(prev_image);
+ *image_ptr = NULL;
+ }
return ZN_OK;
}
@@ -474,6 +478,10 @@ ZnImageParse(ClientData client_data,
}
*image_ptr = image;
}
+ else if (prev_image != NULL) {
+ ZnFreeImage(prev_image);
+ *image_ptr = NULL;
+ }
return ZN_OK;
}
@@ -485,7 +493,7 @@ ZnImagePrint(ClientData client_data,
Tcl_FreeProc **free_proc)
{
ZnImage image = *(ZnImage *) (widget_rec + offset);
- return NewStringObj(ZnNameOfImage(image));
+ return NewStringObj(image?ZnNameOfImage(image):"");
}