]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Defer change set disposal in State.commitWriteTransaction 88/1488/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 21 Feb 2018 10:21:35 +0000 (12:21 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 21 Feb 2018 10:21:35 +0000 (12:21 +0200)
The change set was still used after disposal in notifying db change
listeners.

refs #6233

Change-Id: I3e9f49ea084703afdc2129162402ab592f2f3f72

bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/State.java

index 3199901e90e191962c5815b6bde1623e39cda4f8..91faa719841a534ba5636a815ff1f137dc069368 100644 (file)
@@ -332,7 +332,6 @@ class State {
                 // deny can always remove a persistent statement. 
                 clusterStream.reallyFlush();
 
-                Disposable.safeDispose(session.clientChanges);
                 session.clientChanges = new ClientChangesImpl(session);
 
 
@@ -385,6 +384,7 @@ class State {
             this.close(); // Everything is lost anyway.
             throw new IllegalStateException(e);
         } finally {
+            Disposable.safeDispose(cs);
             lock.unlock();
         }
     }