Skip to content

Commit 0099901

Browse files
committed
Fix issue with bug on win 32 api for timer
1 parent 208f013 commit 0099901

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

JuceLibraryCode/modules/juce_core/native/juce_PlatformTimer_windows.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ class PlatformTimer final
3333
{
3434
jassert (newIntervalMs > 0);
3535

36-
const auto callback = [] (UINT, UINT, DWORD_PTR context, DWORD_PTR, DWORD_PTR)
36+
const auto callback = [] (UINT, UINT, DWORD_PTR context, DWORD_PTR, DWORD_PTR) -> void __stdcall
3737
{
38-
reinterpret_cast<PlatformTimerListener*> (context)->onTimerExpired();
38+
auto* listener = reinterpret_cast<PlatformTimerListener*> (context);
39+
if (listener != nullptr)
40+
listener->handleTimerCallback();
3941
};
4042

4143
timerId = timeSetEvent ((UINT) newIntervalMs, 1, callback, (DWORD_PTR) &listener, TIME_PERIODIC | TIME_CALLBACK_FUNCTION);

0 commit comments

Comments
 (0)