aligned linux code to windows: check if preview pixmap != main pixmap before destroying. probably not needed but good practice

This commit is contained in:
Stefan Schippers 2020-10-20 23:34:40 +02:00
parent 7e845db5df
commit b4681b22af
1 changed files with 3 additions and 2 deletions

View File

@ -836,9 +836,10 @@ void preview_window(const char *what, const char *tk_win_path, const char *filen
xctx = save_xctx; /* restore schematic */
modified = save_mod;
set_modify(modified);
/* free the pixmap used for preview */
/* free the pixmap (if a different one) used for preview */
#ifdef __unix__
XFreePixmap(display,save_pixmap);
if (save_pixmap != save_save_pixmap)
XFreePixmap(display,save_pixmap);
#else
if (save_pixmap != save_save_pixmap)
Tk_FreePixmap(display, save_pixmap);