Try using DisableThreadLibraryCalls() in the DLLmain function of your DLL to disable thread attach/detach notifications that aren't present for normally loaded DLLs.
On 2021-08-06 at 7:32 PM, breadstick <breadstic...@gmail.com> wrote: >The Lua script stays open because I do the message loop with iup.MainLoop(). The scintilla object is still there. > >The dll is loaded when I set loadlexerlibrary="some.dll". I know because the code in the dll reaches DLL_PROCESS_ATTACH in DllMain(). >What happens is that it gets immediately unloaded (so it reaches DLL_PROCESS_DETACH). > >Some example code: > >edit.loadlexerlibrary = "lexluthor.dll" >print("hi") >edit.lexerlanguage = "luthor" >print(edit.lexerlanguage) >... >iup.MainLoop() > >Here, Lua loads the dll, then unloads it, then prints "hi", then prints "nil", and then does the main loop. >I don't know what triggers the unload, because I'm using the very same dll in the test C program and the lexer works. > >Thanks > > > >On Fri, 6 Aug 2021 13:59:20 -0300 >Antonio Scuri <antonio.sc...@gmail.com> wrote: > >> When setting that IUP attribute what we do is exactly the same thing. >> >> It unloads after the script is ended? I mean It actually worked inside >> the script then is unloaded somehow after that? >> >> Is the Scintilla object destroyed when the script ends? >> >> Best, >> Scuri >> >> > > >_______________________________________________ >Iup-users mailing list >Iup-users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/iup-users _______________________________________________ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users