Kaydet (Commit) 2d382cef authored tarafından Damjan Jovanovic's avatar Damjan Jovanovic

Fix a locking bug in our Java ComponentBase class, where after the transition

to disposed, the relevant variables (bDisposed and bInDispose) are written to
outside a synchronized block.

The equivalent C++ implementation in main/cppuhelper/source/implbase.cxx,
method WeakComponentImplHelperBase::dispose(), already does this.

Patch by: me
üst 51f65625
...@@ -92,8 +92,11 @@ public class ComponentBase extends WeakBase implements XComponent ...@@ -92,8 +92,11 @@ public class ComponentBase extends WeakBase implements XComponent
{ {
// finally makes sure that the flags are set even if a RuntimeException is thrown. // finally makes sure that the flags are set even if a RuntimeException is thrown.
// That ensures that this function is only called once. // That ensures that this function is only called once.
bDisposed= true; synchronized (this)
bInDispose= false; {
bDisposed= true;
bInDispose= false;
}
} }
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment