fix #281867 crash on Mac when stopping porttime
This commit is contained in:
parent
003ae6ba6d
commit
b141015f81
7
thirdparty/portmidi/porttime/ptmacosx_cf.c
vendored
7
thirdparty/portmidi/porttime/ptmacosx_cf.c
vendored
|
@ -17,7 +17,7 @@
|
|||
|
||||
static int time_started_flag = FALSE;
|
||||
static CFAbsoluteTime startTime = 0.0;
|
||||
static CFRunLoopRef timerRunLoop;
|
||||
static CFRunLoopRef timerRunLoop = 0;
|
||||
|
||||
typedef struct {
|
||||
int resolution;
|
||||
|
@ -115,7 +115,10 @@ PtError Pt_Stop()
|
|||
{
|
||||
printf("Pt_Stop called\n");
|
||||
|
||||
CFRunLoopStop(timerRunLoop);
|
||||
if (timerRunLoop) {
|
||||
CFRunLoopStop(timerRunLoop);
|
||||
timerRunLoop = 0;
|
||||
}
|
||||
time_started_flag = FALSE;
|
||||
return ptNoError;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue