Skip to content

Commit 63501d3

Browse files
committed
Use SK_SafeCloseHandle in SK_AutoHandle instead of calling CloseHandle directly at shutdown.
1 parent a4a7018 commit 63501d3

2 files changed

Lines changed: 4 additions & 15 deletions

File tree

include/SpecialK/framerate.h

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -172,17 +172,6 @@ namespace SK
172172
SignalObjectAndWait ( worker.hSignalShutdown,
173173
worker.hThread, 2500UL, TRUE );
174174
}
175-
176-
extern volatile LONG __SK_DLL_Ending;
177-
178-
// Let these things leak to avoid problems during shutdown
179-
if (ReadAcquire (&__SK_DLL_Ending))
180-
{
181-
worker.hSignalProduce.m_h = 0;
182-
worker.hSignalConsume.m_h = 0;
183-
worker.hSignalShutdown.m_h = 0;
184-
worker.hThread.m_h = 0;
185-
}
186175
}
187176

188177
std::vector <double>&
@@ -199,9 +188,9 @@ namespace SK
199188
SK_AutoHandle hSignalConsume;
200189
SK_AutoHandle hSignalShutdown;
201190
SK_AutoHandle hThread;
202-
ULONG ulLastFrame = 0;
203-
volatile LONG work_idx = 0;
204-
volatile LONG _init = 0;
191+
ULONG ulLastFrame = 0;
192+
volatile LONG work_idx = 0;
193+
volatile LONG _init = 0;
205194

206195
std::pair <ULONG, std::vector <double> >
207196
sorted_frame_history [2];

include/SpecialK/utility.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class SK_AutoHandle
114114
{
115115
__try
116116
{
117-
CloseHandle (m_h);
117+
SK_SafeCloseHandle (m_h);
118118
}
119119

120120
__finally

0 commit comments

Comments
 (0)