Skip to content

Commit

Permalink
Merge pull request #4822 from AntonioBL/porttime_mac
Browse files Browse the repository at this point in the history
fix #281867 crash on Mac when stopping porttime
  • Loading branch information
anatoly-os committed Mar 28, 2019
2 parents 4898128 + b141015 commit d79d294
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions thirdparty/portmidi/porttime/ptmacosx_cf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit d79d294

Please sign in to comment.