forked from Public-Mirror/Textractor
forgot how lambdas work
This commit is contained in:
parent
464c001773
commit
b82d8d5523
@ -34,18 +34,22 @@ struct : QMainWindow {
|
|||||||
|
|
||||||
BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
|
BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
|
||||||
{
|
{
|
||||||
std::lock_guard l(m);
|
|
||||||
switch (ul_reason_for_call)
|
switch (ul_reason_for_call)
|
||||||
{
|
{
|
||||||
case DLL_PROCESS_ATTACH:
|
case DLL_PROCESS_ATTACH:
|
||||||
{
|
{
|
||||||
QTimer::singleShot(0, [] { (window = new std::remove_pointer_t<decltype(window)>)->Initialize(); });
|
QTimer::singleShot(0, []
|
||||||
|
{
|
||||||
|
std::lock_guard l(m);
|
||||||
|
(window = new std::remove_pointer_t<decltype(window)>)->Initialize();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_PROCESS_DETACH:
|
||||||
{
|
{
|
||||||
if (lpReserved == NULL) // https://blogs.msdn.microsoft.com/oldnewthing/20120105-00/?p=8683
|
if (lpReserved == NULL) // https://blogs.msdn.microsoft.com/oldnewthing/20120105-00/?p=8683
|
||||||
{
|
{
|
||||||
|
std::lock_guard l(m);
|
||||||
delete window;
|
delete window;
|
||||||
window = nullptr;
|
window = nullptr;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user