Jean-Marc Lasgouttes wrote:
"Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:

 What about removing the buffer from the lyxview, and reading from
disk as with a new file?

Abdelrazak> ??? This is what is done already in
Abdelrazak> BufferView::loadLyXFile().

So, there is no more bufferview concerning the file, but qt manages
nevertheless to find somewhere a partly updated buffer object and crash
on it?

No, there is no more buffer, that is different. The Buffer pointer in BufferView was not properly set to zero when the Buffer was closed file was reloaded hence one the crashes.

FYI, there is a one/one relationship between WorkArea and BufferView. The WorkArea uses the BufferView as a kernel tool to know what to draw on screen.


What I was describing is something like

- remove old bufferview from LyXView
- read new buffer - add new bufferview to LyXView

No you were talking about the buffer, quoting you:
 What about removing the buffer from the lyxview, and reading from
disk as with a new file?

We can not remove the old BufferView from LyXView as it belongs to the WorkArea. And there is no need to anyway.

If this is what we are doing, how comes qt crashes?

No. And this has nothing to do with the BufferView which stays valid all along. Only the attached Buffer was not valid during the switching.


Abdelrazak> Read my last patch more carefully before further
Abdelrazak> commenting.

Or what about telling Qt to give up updates until we are done?

Abdelrazak> ??? this is exactly what I am doing there:

I was proposing that as a second solution. I still prefer the first
(although it seems I maybe misunderstanding something).

I am doing both anyway now:

1) make sure the buffer reloading is properly done
2) make sure the screen update is disabled during this reloading.

Abdel.



Reply via email to