Skip to content

Commit

Permalink
dmime: Avoid leaking performance channel block ports.
Browse files Browse the repository at this point in the history
CW-Bug-Id: #16680
CW-Bug-Id: #20424
CW-Bug-Id: #22409
  • Loading branch information
rbernon committed Nov 6, 2023
1 parent 6247e5f commit 9c5c67a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dlls/dmime/performance.c
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@ static HRESULT perf_dmport_create(struct performance *perf, DMUS_PORTPARAMS *par
}

performance_update_latency_time(perf, port, NULL);
IDirectMusicPort_Release(port);
return S_OK;
}

Expand Down Expand Up @@ -1198,6 +1199,8 @@ static HRESULT WINAPI performance_AssignPChannelBlock(IDirectMusicPerformance8 *
channel->midi_group = midi_group;
channel->midi_channel = i;
channel->port = port;
if (channel->port) IDirectMusicPort_Release(channel->port);
if ((channel->port = port)) IDirectMusicPort_AddRef(channel->port);
}

return S_OK;
Expand All @@ -1218,6 +1221,7 @@ static HRESULT WINAPI performance_AssignPChannel(IDirectMusicPerformance8 *iface
channel->midi_group = midi_group;
channel->midi_channel = midi_channel;
channel->port = port;
IDirectMusicPort_AddRef(port);

return S_OK;
}
Expand Down

0 comments on commit 9c5c67a

Please sign in to comment.