When to call NPPM_DESTROYSCINTILLAHANDLE ?
-
Hi everyone,
I’m working on a C# plugin and use NPPM_CREATESCINTILLAHANDLE to get a Scintilla instance.
It all works as expected, and as directed on the wiki Messages And Notifications page I call NPPM_DESTROYSCINTILLAHANDLE when I am done.
Thereafter NPP appears to work correctly, but soon crashes with an Access Violation when doing ScintillaEditView::attachDefaultDoc()… well away from my plugin which is by now dormant. If I skip the DESTROY call, the crash does not occur.
So is NPPM_DESTROYSCINTILLAHANDLE only intended to be called on Notepad++ shutdown?
Or is there some other action I need to take first?NB: This is running NPP and my plugin through VS2017 IDE debugger, and is currently using NPP v7.4.2 source (slightly modified)… so please just after general advice on the create/destroy handle thing before trying to isolate the error further.
Specifically the crash happens on the “isVisibile” line here:
size_t FileManager::nextUntitledNewNumber() const { std::vector<size_t> usedNumbers; for(size_t i = 0; i < _buffers.size(); i++) { Buffer *buf = _buffers.at(i); if (buf->isUntitled()) { // if untitled document is invisible, then don't put its number into array (so its number is available to be used) if ((buf->_referees[0])->isVisible()) ...Cheers,
Moon
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login