On 03/09/2010 01:05 PM, rgheck wrote:
On 03/09/2010 03:38 AM, Abdelrazak Younes wrote:
On 03/08/2010 08:07 PM, [email protected] wrote:
Author: rgheck
Date: Mon Mar 8 20:07:05 2010
New Revision: 33679
URL: http://www.lyx.org/trac/changeset/33679
Log:
Introduce isBufferValid() method now, that returns true also for cloned
Buffers. Use it, as well.
I don't understand the need for this. I mean, we shouldn't be needing
this method. If we need the buffer then the buffer must be set,
period. So I would just access buffer() and fixes upward the cases
where buffer_ is not properly set.
It's less the check for buffer_ than it is for the Buffer actually
being loaded. There are, or at least used to be, cases where a Buffer
got unloaded when some other file still had pointers to it. This could
happen now, I'd guess, if you opened a new file that included the same
child as an existing master. The parent gets reset. The old master
still has pointers to that child. Now close the new file and its child.
Sure, the old master still has pointers to that child but those are
valid as long as the child is alive. The bug would be that the child is
allowed to be closed at the first place. When closing a file we need to
make sure that it is not the child of some other document than its
current master.
There are probably other ways to get the same effect.
I reckon all those ways should be fixed as well...
Now, I am not asking you to fix those long standing issues of course :-)
Abdel.