File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,10 @@ AXUIElementRef getAXWindow(int pid, int handle) {
9797 obj.Set (" id" , [windowNumber intValue ]);
9898 obj.Set (" processId" , [ownerPid intValue ]);
9999 obj.Set (" path" , [app.bundleURL.path UTF8String ]);
100- m[[windowNumber intValue ]] = getAXWindow ([ownerPid intValue ], [windowNumber intValue ]);
100+
101+ if (m.find ([windowNumber intValue ]) == m.end ()) {
102+ m[[windowNumber intValue ]] = getAXWindow ([ownerPid intValue ], [windowNumber intValue ]);
103+ }
101104
102105 return obj;
103106 }
@@ -138,7 +141,10 @@ AXUIElementRef getAXWindow(int pid, int handle) {
138141 obj.Set (" path" , [app.bundleURL.path UTF8String ]);
139142 obj.Set (" bounds" , boundsObj);
140143 obj.Set (" title" , [windowName UTF8String ]);
141- m[[windowNumber intValue ]] = getAXWindow ([ownerPid intValue ], [windowNumber intValue ]);
144+
145+ if (m.find ([windowNumber intValue ]) == m.end ()) {
146+ m[[windowNumber intValue ]] = getAXWindow ([ownerPid intValue ], [windowNumber intValue ]);
147+ }
142148
143149 return obj;
144150 }
You can’t perform that action at this time.
0 commit comments