Skip to content

Commit 730b18e

Browse files
committed
Added synchronization to Proxy.dispose(). shannah#24
1 parent a60d760 commit 730b18e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/ca/weblite/objc/Proxy.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,11 @@ public static Proxy load(Pointer peer){
184184
* leave the Objective-C object intact.
185185
*/
186186
public void dispose(boolean sendDeallocMessage){
187-
proxyCache.remove(getPeer());
188-
if ( sendDeallocMessage ){
189-
send("dealloc");
187+
synchronized(proxyCache) {
188+
proxyCache.remove(getPeer());
189+
if ( sendDeallocMessage ){
190+
send("dealloc");
191+
}
190192
}
191193
}
192194

0 commit comments

Comments
 (0)