fix a crash due to reentrant call of preview schematic drawing caused by an Expose event if an alert box is displayed due to errors in schematic to preview

This commit is contained in:
Stefan Frederik 2022-09-17 11:27:42 +02:00
parent 52405a29c7
commit 5dc0b14de4
5 changed files with 1934 additions and 1908 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Xschem" Language="1033" Version="3.1.0" Manufacturer="Xschem" UpgradeCode="0deb9c17-cbbd-491c-be3e-24446b27ccd5">
<Product Id="*" Name="Xschem" Language="1033" Version="3.1.1" Manufacturer="Xschem" UpgradeCode="0deb9c17-cbbd-491c-be3e-24446b27ccd5">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<WixVariable Id="WixUILicenseRtf"
Value="License.rtf" />
@ -156,6 +156,9 @@
<Component Id="CMPSRCRESOURCESTCL">
<File Id="RESOURCESTCL" KeyPath="yes" Source="../../src/resources.tcl" />
</Component>
<Component Id="CMPSRCADDCUSTOMBUTTONTCL">
<File Id="ADDCUSTOMBUTTONTCL" KeyPath="yes" Source="../../src/add_custom_button.tcl" />
</Component>
<Component Id="CMPSORTLABELSAWK">
<File Id="SORTLABELSAWK" KeyPath="yes" Source="../../src/sort_labels.awk" />
</Component>
@ -311,7 +314,8 @@
</ComponentGroup>
<ComponentGroup Id="share">
<ComponentRef Id="CMPSRCRESOURCESTCL" />
<ComponentRef Id="CMPSRCXSCHEMRC" />
<ComponentRef Id="CMPSRCADDCUSTOMBUTTONTCL" />
<ComponentRef Id="CMPSRCXSCHEMRC" />
<ComponentRef Id="CMPBREAKAWK" />
<ComponentRef Id="CMPCHANGEINDEXTCL" />
<ComponentRef Id="CMPCHANGEREFAWK" />

File diff suppressed because it is too large Load Diff

View File

@ -279,6 +279,12 @@
<Component Id="cmpD97AE943007C3AC19332BBE4DD1231CC" Guid="{9E87B48E-7BAC-4BA7-ADB9-AF663E891C8F}">
<File Id="fil15C79DAD681B86515BAC306AF0B7612A" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\devices\rnmos4.sym" />
</Component>
<Component Id="cmpCEAF5664B6AEF38BECFAF994B2D9A81A" Guid="{A517C018-1127-452D-8357-1A449A11195F}">
<File Id="fil12E4A855EEBC2ECDE931964FDE1236E8" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\devices\simulator_commands.sym" />
</Component>
<Component Id="cmp0F9FB8C96A0FFABEBE019FD047730B71" Guid="{58D791FA-7972-42E8-8F6A-A6979B43BD12}">
<File Id="fil78EBD0476AD4F83AC6CE17505FD4527D" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\devices\simulator_commands_shown.sym" />
</Component>
<Component Id="cmpC0CDD9987356F9D8308F1F96CAA35403" Guid="{1AE154F8-0F7C-4E22-86F5-93F626D48901}">
<File Id="filEFB8AA2EEFBD6AE16A045E4F3A3EFD2B" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\devices\spice_probe.sym" />
</Component>
@ -5510,6 +5516,8 @@
<ComponentRef Id="cmpA6D9B275607613A4C61E8980D499B751" />
<ComponentRef Id="cmpE33D206A79E72DCC203BF9219CECA21A" />
<ComponentRef Id="cmpD97AE943007C3AC19332BBE4DD1231CC" />
<ComponentRef Id="cmpCEAF5664B6AEF38BECFAF994B2D9A81A" />
<ComponentRef Id="cmp0F9FB8C96A0FFABEBE019FD047730B71" />
<ComponentRef Id="cmpC0CDD9987356F9D8308F1F96CAA35403" />
<ComponentRef Id="cmp530072B273A8627AFC7F2E628B5116CE" />
<ComponentRef Id="cmpC76DA8327344C4B4AB04EF665B72B736" />

View File

@ -1114,7 +1114,12 @@ void preview_window(const char *what, const char *win_path, const char *fname)
static Xschem_ctx *preview_xctx = NULL; /* save pointer to current schematic context structure */
static Window pre_window;
static Tk_Window tkpre_window;
static int semaphore=0;
/* avoid reentrant calls for example if an alert box is displayed while loading file to preview,
* and an Expose event calls another preview draw */
if(semaphore) return;
semaphore++;
dbg(1, "------\n");
if(!strcmp(what, "create")) {
dbg(1, "preview_window() create, save ctx, win_path=%s\n", win_path);
@ -1160,6 +1165,7 @@ void preview_window(const char *what, const char *win_path, const char *fname)
save_xctx = NULL;
set_modify(-1);
}
semaphore--;
}
/* check if filename is already loaded into a tab or window */

View File

@ -33,8 +33,8 @@ y1 = -0.048929
y2 = 0.999755
divy = 3
subdivy=1
x1=6.98337e-08
x2=4.61214e-07 divx=10
x1=100n
x2=400n divx=10
node="ldbl[0]
ldbl[16]
ldbl[32]
@ -52,8 +52,8 @@ y1 = 0
y2 = 1.60
subdivy=1
divy = 4
x1=6.98337e-08
x2=4.61214e-07
x1=100n
x2=400n
divx=10
subdivx=4
node="ldcp
@ -71,8 +71,8 @@ y2 = 1.6
divy = 3
subdivy=0
subdivx = 1
x1=6.98337e-08
x2=4.61214e-07 divx=10
x1=100n
x2=400n divx=10
node="ldwl[0]
ldwl[1]
ldwl[2]
@ -94,8 +94,8 @@ y2 = 1.6
ypos1=0.0990096
ypos2=2.81842
divy = 1
x1=6.98337e-08
x2=4.61214e-07
x1=100n
x2=400n
divx=12
subdivx=4
node="---In/Out---
@ -123,8 +123,8 @@ B 2 1840 -1300 2890 -1160 {flags=graph
y1 = 0
y2 = 1.60
divy = 4
x1=6.98337e-08
x2=4.61214e-07
x1=100n
x2=400n
divx=8
unitx=n
node="xsa[0].ldqib
@ -137,8 +137,8 @@ B 2 1840 -240 2890 0 {flags=graph
y1 = -0.049
y2 = 0.00057
divy = 5
x1=6.98337e-08
x2=4.61214e-07
x1=100n
x2=400n
unity=m
divx=10
subdivx=1