summaryrefslogtreecommitdiffstats
path: root/generic/tkImage.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2023-10-28 08:18:10 (GMT)
committerfvogel <fvogelnew1@free.fr>2023-10-28 08:18:10 (GMT)
commit0458372801c219f49668c4d8bc66406008375599 (patch)
treef032e3df8b5863b818b232f8663fd4067bd6418a /generic/tkImage.c
parentc42b8f8272355924ac24d0837c756b6916bfa8cf (diff)
downloadtk-0458372801c219f49668c4d8bc66406008375599.zip
tk-0458372801c219f49668c4d8bc66406008375599.tar.gz
tk-0458372801c219f49668c4d8bc66406008375599.tar.bz2
Fix [bb8041c239]: Call legacy Tk_ImageCreateProc using correct function pointer type. Thanks to Christopher Chavez.
Diffstat (limited to 'generic/tkImage.c')
-rw-r--r--generic/tkImage.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/generic/tkImage.c b/generic/tkImage.c
index e76f2da..1f62ad4 100644
--- a/generic/tkImage.c
+++ b/generic/tkImage.c
@@ -372,8 +372,17 @@ Tk_ImageObjCmd(
args[objc] = NULL;
}
Tcl_Preserve(modelPtr);
- if (typePtr->createProc(interp, name, objc, args, typePtr,
- (Tk_ImageModel)modelPtr, &modelPtr->modelData) != TCL_OK){
+ if (oldimage) {
+ typedef int (OldCreateProc)(Tcl_Interp*, char*, int, char**,
+ Tk_ImageType*, Tk_ImageModel, ClientData*);
+ i = ((OldCreateProc*)typePtr->createProc)(interp,
+ (char*)name, objc, (char**)args, typePtr,
+ (Tk_ImageModel)modelPtr, &modelPtr->modelData);
+ } else {
+ i = typePtr->createProc(interp, name, objc, args, typePtr,
+ (Tk_ImageModel)modelPtr, &modelPtr->modelData);
+ }
+ if (i != TCL_OK){
EventuallyDeleteImage(modelPtr, 0);
Tcl_Release(modelPtr);
if (oldimage) {