diff options
author | culler <culler> | 2018-11-21 06:44:28 (GMT) |
---|---|---|
committer | culler <culler> | 2018-11-21 06:44:28 (GMT) |
commit | fc12eac9417801a452f0e1c56bc3b89dfa8581bc (patch) | |
tree | c4bb9faf5e2223b97711e56334a4eb286141b2d0 /generic | |
parent | 2cb045114a45384942c633c911748643d7f5fe1b (diff) | |
parent | 5e47d46cce7794b3e23422170e464555fb171ce5 (diff) | |
download | tk-fc12eac9417801a452f0e1c56bc3b89dfa8581bc.zip tk-fc12eac9417801a452f0e1c56bc3b89dfa8581bc.tar.gz tk-fc12eac9417801a452f0e1c56bc3b89dfa8581bc.tar.bz2 |
Protect against the possibility that a future platform might have a strange implementaton of XDestroyImage.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/ttk/ttkDefaultTheme.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 803d254..7ac0237 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -611,10 +611,22 @@ static void IndicatorElementDraw( spec->width, spec->height); /* - * Tidy up. Note that XDestroyImage frees img->data. + * Tidy up. */ Tk_FreeGC(display, copyGC); + + /* + * Protect against the possibility that some future platform might + * not use the Tk memory manager in its implementation of XDestroyImage, + * even though that would be an extremely strange thing to do. + */ + +#if defined(IGNORES_VISUAL) + ckfree(img->data); + img->data = NULL; +#endif + XDestroyImage(img); } |