Martin Gallwey wrote:

Could be seen as a bug. Some API calls in the model set the flag.
Because we know this ;-) usually we clear the modified flag after
successful loading. Need to check why it doesn't work here.
If I save the document it (obviously) gets rid of the modified flag, and I am then able to reload once. If I reload a second time, it comes in read-only. If I use a macro to get rid of the modified flag and then reload it comes in read-only.

2. When I reload the document, it comes back in as read-only.


You could have become a victim of the garbage collection.
You have got a reference to a stream in the MediaDescriptor. As long as
this reference is kept you can't open the document in read/write mode.
In a C++ based filter the reference is cleared automatically when the
filter service is released, but the Java garbage collection has its own
will so it might be possible that while you reload the file the
So please clear the reference explicitly after successful loading and
report back if this makes any difference.

Yeah, that was my theory as well, but I can't definitely be sure that the proxy object is being deleted which would result in the ref count of the XInputStream decrementing, due to the asynchronous nature of Java's garbage collection. I've tried getting medieval on it with code like this:

   xInputStream = null;
   aDescriptor[nInputStreamIndex] = null;
   aDescriptor = null;
   System.gc();
   System.runFinalization();

But it doesn't help!

If you want to make sure (for test purposes) that an object has been garbage collected, have a look at qadevOOo/runner/util/WaitUnreachable.java.

-Stephan

Thanks,

Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to