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.

> 1.  Gets the next line of text in a document:
>    a. Use GetCurrentPos() to determine where we are in the document;
>    b. Use GetCharAt() to see where the end of the current sentence is;
>    c. Use GetTextRange() to get the sentence text (I am currently returning
> this as a BSTR, but need to use UCS2FromUTF8 to convert it properly).
> 2.  Hilight each word as they are being read using SetSel().
>
> 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.

> 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.

   Neil

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

Reply via email to