pl_win_midi coponents memory leak
Original Reporter info from Mantis: j3llie
-
Reporter name: John Elston
Original Reporter info from Mantis: j3llie
- Reporter name: John Elston
Description:
cmpMidiOutput.pas and cmpMidiInput.pas cause memory leak for several components
Steps to reproduce:
Start new project.
drop WinMidiEngine onto form
compile in debug mode
close project and a debug message is shown
Additional information:
Here is a posible fix to the problem
n file cmpMidiInput.pas
destructor TMidiInput.Destroy;
var
idx : TPortRange;
i : Integer;
begin
for idx := Low (TPortRange) to High (TPortRange) do
ClosePort (idx);
while fSysexHeaders.Count > 0 do
TidySysexBuffers;
fSysexHeaders.free; // now no memory leaks
SetRecording (False, Nil);
for i := 0 to fTakes.Count - 1 do
TObject (fTakes [i]).Free;
fTakes.Free;
if assigned(fRecordBuffer) then fRecordBuffer.free;
if assigned(fMidiEchoPort) then fMidiEchoPort.Free;
inherited;
end;
------------------------------------------------------
Add to cmpMidiOutput.pas
destructor TMidiOutputPort.Destroy;
begin
Active := False;
WaitForSysex;
fSysexHeaders.Free; // avoid memory leaks
inherited
end;
Mantis conversion info:
- Mantis ID: 36800
- OS: Windows 10 x64
- OS Build: Home
- Platform: Intel i5-7200U CPU
- Version: 2.0.6