Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibilty with other plugins written in Delphi #311

Open
chcg opened this issue Jan 6, 2023 · 2 comments
Open

Compatibilty with other plugins written in Delphi #311

chcg opened this issue Jan 6, 2023 · 2 comments

Comments

@chcg
Copy link
Contributor

chcg commented Jan 6, 2023

See analysis for notepad-plus-plus/notepad-plus-plus#4427

After removing all plug-ins and adding them back in one-by-one I found that Zoom Disabler 1.2 is causing this same error.

You're on the right track. The underlying problem is that DSpellCheck does not play nice with plugins coded in Delphi1, like Zoom Disabler and the — #173 (comment) — ExtSettings plugin.

Delphi plugins implicitly call into COM libraries to create and destroy dialog windows. DSpellCheck makes explicit calls to the same functions, against the advice of Microsoft to never call them from the context of DllMain,

[b]ecause there is no way to control the order in which in-process servers are loaded or unloaded

DSpellCheck invalidates the Delphi plugin's own de-initialization by releasing the same resources first.
Footnotes

@rdipardo
Copy link

rdipardo commented Feb 8, 2023

See analysis for notepad-plus-plus/notepad-plus-plus#4427

My thinking has changed since that earlier post; see StanDog/npp-zoomdisabler#3 (comment)

@Predelnik
Copy link
Owner

I don't think it's correct statement that CoUninitialize is called inside DllMain in DSpellCheck, particularly NativeSpellerInterface::cleanup is called on NPPN_SHUTDOWN. There is also another call during browse for directory but this one probably irrelevant and could be removed.

I think what I can do is to never call CoInitialize/CoUninitialize unless native speller is used, that would probably make it ok for most of the cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants