Skip to content

Commit

Permalink
Fix [3981091e] Segmentation fault with bogus resource value (X11)
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Sep 20, 2024
2 parents 38c4c8b + c55134b commit 297b243
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions generic/ttk/ttkTheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,10 @@ void Ttk_TkDestroyedHandler(
StylePackageData* pkgPtr = GetStylePackageData(interp);

/*
* Cancel any pending ThemeChanged calls:
* Cancel any pending ThemeChanged calls. We might be called
* before Ttk is initialized. See bug [3981091ed336].
*/
if (pkgPtr->themeChangePending) {
if (pkgPtr && pkgPtr->themeChangePending) {
Tcl_CancelIdleCall(ThemeChangedProc, pkgPtr);
}
}
Expand Down Expand Up @@ -1327,7 +1328,9 @@ static int StyleLookupCmd(
}

style = Ttk_GetStyle(theme, Tcl_GetString(objv[2]));

if (!style) {
return TCL_ERROR;
}
optionName = Tcl_GetString(objv[3]);

if (objc >= 5) {
Expand All @@ -1352,7 +1355,7 @@ static int StyleLookupCmd(
}

static int StyleThemeCurrentCmd(
void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj * const objv[])
void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[])
{
StylePackageData *pkgPtr = (StylePackageData *)clientData;
Tcl_HashSearch search;
Expand Down

0 comments on commit 297b243

Please sign in to comment.