From 197286c21e923e3b962a76c83d73fe72c560f637 Mon Sep 17 00:00:00 2001 From: Alekhya Kommuru Date: Fri, 17 Jan 2020 14:23:07 -0800 Subject: [PATCH] moved app name to constructor to init only once --- src/modules/powerrename/dll/PowerRenameExt.cpp | 2 +- src/modules/powerrename/dll/dllmain.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/powerrename/dll/PowerRenameExt.cpp b/src/modules/powerrename/dll/PowerRenameExt.cpp index 7778afa5b2..898fc92db1 100644 --- a/src/modules/powerrename/dll/PowerRenameExt.cpp +++ b/src/modules/powerrename/dll/PowerRenameExt.cpp @@ -21,6 +21,7 @@ struct InvokeStruct CPowerRenameMenu::CPowerRenameMenu() { ModuleAddRef(); + app_name = GET_RESOURCE_STRING(IDS_POWERRENAME); } CPowerRenameMenu::~CPowerRenameMenu() @@ -197,7 +198,6 @@ DWORD WINAPI CPowerRenameMenu::s_PowerRenameUIThreadProc(_In_ void* pData) HRESULT __stdcall CPowerRenameMenu::GetTitle(IShellItemArray* /*psiItemArray*/, LPWSTR* ppszName) { - app_name = GET_RESOURCE_STRING(IDS_POWERRENAME); return SHStrDup(app_name.c_str(), ppszName); } diff --git a/src/modules/powerrename/dll/dllmain.cpp b/src/modules/powerrename/dll/dllmain.cpp index 832ffac048..0bfa4459af 100644 --- a/src/modules/powerrename/dll/dllmain.cpp +++ b/src/modules/powerrename/dll/dllmain.cpp @@ -167,7 +167,6 @@ public: // Return the display name of the powertoy, this will be cached virtual PCWSTR get_name() override { - app_name = GET_RESOURCE_STRING(IDS_POWERRENAME); return app_name.c_str(); } @@ -301,6 +300,7 @@ public: PowerRenameModule() { init_settings(); + app_name = GET_RESOURCE_STRING(IDS_POWERRENAME); } ~PowerRenameModule(){};