File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed
Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -40,15 +40,16 @@ template <typename T = void*> class GlobalHandleLock {
4040 throw std::runtime_error (" Failed to Free Resource Handle" );
4141 }
4242 }
43- } else {
44- if (!GlobalUnlock (globalHandle)) {
45- if (GetLastError () != NO_ERROR) {
46- throw std::runtime_error (" Failed to Unlock Global Handle" );
47- }
43+ return ;
44+ }
4845
49- if (GlobalFree (globalHandle) != NULL ) {
50- throw std::runtime_error (" Failed to Free Global Handle" );
51- }
46+ if (!GlobalUnlock (globalHandle)) {
47+ if (GetLastError () != NO_ERROR) {
48+ throw std::runtime_error (" Failed to Unlock Global Handle" );
49+ }
50+
51+ if (GlobalFree (globalHandle) != NULL ) {
52+ throw std::runtime_error (" Failed to Free Global Handle" );
5253 }
5354 }
5455 #endif
@@ -160,10 +161,7 @@ template <typename T = void*> class GlobalHandleLock {
160161 return GetHandleSize (globalHandle);
161162 #endif
162163 #ifdef WINDOWS
163- if (resource) {
164- return resourceSize;
165- }
166- return GlobalSize (globalHandle);
164+ return resource ? resourceSize : GlobalSize (globalHandle);
167165 #endif
168166 }
169167
You can’t perform that action at this time.
0 commit comments