Hi Guys,

The !makingRoomForNew clause needs to be there.  For this 
case, since the buffer is being re-initialized, InitBuffer 
has to be called (which happens on line 569) instead of 
ActivateBuffer.

Actually I don't think OnSwitchFile should be called in this 
case, as it is not supposed to be called for new buffers - 
only for switching to an existing buffer.  So I think the 
correct fix is probably on line 645:

 if (extender && !closingLast && !makingRoomForNew) {
  extender->OnSwitchFile(filePath.AsFileSystem());
 }

Regards,
Bruce


"Neil Hodgson" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> [Redirecting to mailing list as it looks like a Bruce 
> Dodson issue]
>
> Kein-Hong Man:
>
>> Got a reproducible test case:
>> (1) Open the maximum number of buffers
>> (2) Create a new buffer
>>
>> Bug is due to the following:
>> (1) SciTEBuffers.cxx[549], SciTEBase::New:
>>      Close() called with makingRoomForNew=true
>> (2) SciTEBuffers.cxx[595-599], SciTEBase::Close:
>>      In 596, extender->RemoveBuffer is called:
>>          In LuaExtension.cxx, curBufferIndex set to -1 in
>>          anticipation of ActivateBuffer call.
>>      In 599, extender->ActivateBuffer is called, but due
>>      to the condition (extender && !makingRoomForNew), 
>> this
>>      never happens and curBufferIndex is still -1.
>
>   It looked to me like removing the !makingRoomForNew 
> clause would
> fix this but its an explicit piece of code (that is, it 
> has no point
> unless it avoids the call) and I'm not sure about the 
> reasoning behind
> it so it would be best for Bruce to OK removing it.
>
>> (3) So upon buffer initialization, the error message
>>      from line 311 in LuaExtension.cxx appears.
>
>   Neil 



_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to