Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | fix crash in tk menu |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
c1c677ed04ce5d338f64611c12ce6080 |
User & Date: | chw 2024-11-25 21:01:04.474 |
Context
2024-11-26
| ||
04:24 | update sqlite to version 3.47.1 check-in: 106a26d6c2 user: chw tags: trunk | |
2024-11-25
| ||
21:01 | fix crash in tk menu check-in: c1c677ed04 user: chw tags: trunk | |
20:48 | add selected tk upstream changes check-in: b6eddc734c user: chw tags: trunk | |
Changes
Changes to jni/sdl2tk/generic/tkMenu.c.
︙ | ︙ | |||
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 | * Tk Bug [2d3a81c0]. */ int index) /* The zero based index of the item we are * invoking. */ { int result = TCL_OK; TkMenuEntry *mePtr; if (index < 0) { goto done; } mePtr = menuPtr->entries[index]; if (mePtr->state == ENTRY_DISABLED) { goto done; } | > > > > > > > > > > > > | | | | | | | | | < > | > | 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 | * Tk Bug [2d3a81c0]. */ int index) /* The zero based index of the item we are * invoking. */ { int result = TCL_OK; TkMenuEntry *mePtr; Tcl_Obj *commandPtr = NULL, *namePtr = NULL; if (index < 0) { goto done; } mePtr = menuPtr->entries[index]; if (mePtr->state == ENTRY_DISABLED) { goto done; } if (mePtr->commandPtr != NULL) { commandPtr = mePtr->commandPtr; Tcl_IncrRefCount(commandPtr); } if ((mePtr->type == CHECK_BUTTON_ENTRY) || (mePtr->type == RADIO_BUTTON_ENTRY)) { if (mePtr->namePtr != NULL) { namePtr = mePtr->namePtr; Tcl_IncrRefCount(namePtr); } } if (mePtr->type == TEAROFF_ENTRY) { Tcl_DString ds; Tcl_DStringInit(&ds); Tcl_DStringAppend(&ds, "tk::TearOffMenu ", -1); Tcl_DStringAppend(&ds, Tk_PathName(menuPtr->tkwin), -1); result = Tcl_EvalEx(interp, Tcl_DStringValue(&ds), -1, TCL_EVAL_GLOBAL); Tcl_DStringFree(&ds); } else if ((mePtr->type == CHECK_BUTTON_ENTRY) && (namePtr != NULL)) { Tcl_Obj *valuePtr; if (mePtr->entryFlags & ENTRY_SELECTED) { valuePtr = mePtr->offValuePtr; } else { valuePtr = mePtr->onValuePtr; } if (valuePtr == NULL) { valuePtr = Tcl_NewObj(); } Tcl_IncrRefCount(valuePtr); if (Tcl_ObjSetVar2(interp, namePtr, NULL, valuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { result = TCL_ERROR; } Tcl_DecrRefCount(valuePtr); } else if ((mePtr->type == RADIO_BUTTON_ENTRY) && (namePtr != NULL)) { Tcl_Obj *valuePtr = mePtr->onValuePtr; if (valuePtr == NULL) { valuePtr = Tcl_NewObj(); } Tcl_IncrRefCount(valuePtr); if (Tcl_ObjSetVar2(interp, namePtr, NULL, valuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { result = TCL_ERROR; } Tcl_DecrRefCount(valuePtr); } /* * We check numEntries in addition to whether the menu entry has a command * because that goes to zero if the menu gets deleted (e.g., during * command evaluation). */ if ((menuPtr->numEntries != 0) && (result == TCL_OK) && (commandPtr != NULL)) { result = Tcl_EvalObjEx(interp, commandPtr, TCL_EVAL_GLOBAL); } if (commandPtr != NULL) { Tcl_DecrRefCount(commandPtr); } if (namePtr != NULL) { Tcl_DecrRefCount(namePtr); } done: return result; } /* *---------------------------------------------------------------------- |
︙ | ︙ |