aboutsummaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
Diffstat (limited to 'c')
-rw-r--r--c/main.cpp8
-rw-r--r--c/wcharptr.cpp5
2 files changed, 6 insertions, 7 deletions
diff --git a/c/main.cpp b/c/main.cpp
index b0fd7d3..6878390 100644
--- a/c/main.cpp
+++ b/c/main.cpp
@@ -121,10 +121,6 @@ int WINAPI WinMain(const HINSTANCE hInstance, const HINSTANCE, char* const, cons
icc.dwICC = ICC_WIN95_CLASSES;
Require(InitCommonControlsEx(&icc));
- /* Load context menu. */
- g_hMenuPopup = Require(LoadMenu(nullptr, MAKEINTRESOURCE(IDR_POPUPMENU)));
- g_hMenuPopup = Require(GetSubMenu(g_hMenuPopup, 0));
-
WNDCLASSEX wc;
memset(&wc, 0, sizeof(WNDCLASSEX));
wc.cbSize = sizeof(WNDCLASSEX);
@@ -210,6 +206,10 @@ void InitializeMainWindow(const HWND hWnd)
SetWindowTheme = (decltype(SetWindowTheme))(void*)GetProcAddress(hModule, "SetWindowTheme");
}
+ /* Load context menu. */
+ g_hMenuPopup = Require(LoadMenu(nullptr, MAKEINTRESOURCE(IDR_POPUPMENU)));
+ g_hMenuPopup = Require(GetSubMenu(g_hMenuPopup, 0));
+
/* Create child windows. */
g_dlv = new DataListView(hWnd);
g_elv = new EpisodeListView(hWnd);
diff --git a/c/wcharptr.cpp b/c/wcharptr.cpp
index f36c620..f659767 100644
--- a/c/wcharptr.cpp
+++ b/c/wcharptr.cpp
@@ -24,7 +24,6 @@ WcharPtr WcharPtr::Copy(const wchar_t* const src)
return dst;
}
-
WcharPtr::WcharPtr() noexcept {}
WcharPtr::~WcharPtr() noexcept
@@ -59,7 +58,7 @@ WcharPtr& WcharPtr::operator=(WcharPtr&& other) noexcept
wchar_t* WcharPtr::Release() noexcept
{
- wchar_t* p2 = m_p;
+ wchar_t* const p = m_p;
m_p = nullptr;
- return p2;
+ return p;
}