Neil Hodgson wrote:
Reece Dunn:
> I am using Scintilla 1.67 in a project of mine and am getting the
following
> assertion in LineLayoutCache::AllocateForLevel:
> PLATFORM_ASSERT(useCount == 0);
>
> What is this ensuring? What is useCount used for?
useCount was introduced in 1.67 to help debug situations where an
element in the line cache was being changed while it was being used.
The rule now is that only one element (line) from the line cache may
be referenced at a time and useCount counts the number of references
handed out. PLATFORM_ASSERT is only active in debug builds and
situations where multiple references are handed out may work OK in
practice.
Thanks for the information.
> After a while, the assertion is triggered.
Its reasonably difficult to create a situation where the assertion
is likely unless you are reentering Scintilla, perhaps by calling
Scintilla within a notification handler.
Ah yes! The notifications are generated on a separate thread.
I also notice this assertion while reading the document (using notifications
from a separate thread) and you then switch to another document. This may be
related to the above.
> NOTE: I am using SetCaretLineVisible(true). This will sometimes keep the
> previous line drawn with the caret visible look.
There was a "Caret line background problems" thread about this
starting Jan 4 with a patch.
Cool!
There is another issue when using SetSel() programatically to cause line
scrolling: you can see this more clearly when displaying line numbers. The
observed behaviour seems to be that sometimes the wrong line gets drawn.
When using the up/down arrow keys there isn't a problem.
Also, if a line is partially hidden, the last visible line gets partially
drawn.
Thanks,
- Reece
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest