Debugger: Fixed an issue, with freeing objects, on certain gdb errors

git-svn-id: trunk@31833 -
This commit is contained in:
martin 2011-07-30 23:51:26 +00:00
parent 226bb2cc9a
commit 1ee93b1f0d

View File

@ -590,6 +590,7 @@ type
function DoExecute: Boolean; override;
public
constructor Create(AOwner: TGDBMIDebugger; AContinueCommand: TGDBMIDebuggerCommand);
destructor Destroy; override;
function DebugText: String; override;
property ContinueCommand: TGDBMIDebuggerCommand read FContinueCommand;
property Success: Boolean read FSuccess;
@ -3967,8 +3968,7 @@ begin
if DebuggerState = dsPause
then ProcessFrame;
finally
if assigned(FContinueCommand)
then FContinueCommand.Free;
ReleaseAndNil(FContinueCommand);
end;
FSuccess := True;
@ -3978,10 +3978,18 @@ constructor TGDBMIDebuggerCommandStartDebugging.Create(AOwner: TGDBMIDebugger;
AContinueCommand: TGDBMIDebuggerCommand);
begin
inherited Create(AOwner);
// AContinueCommand, takes over the current reference.
// Caller will never Release it. So TGDBMIDebuggerCommandStartDebugging must do this
FContinueCommand := AContinueCommand;
FSuccess := False;
end;
destructor TGDBMIDebuggerCommandStartDebugging.Destroy;
begin
ReleaseAndNil(FContinueCommand);
inherited Destroy;
end;
function TGDBMIDebuggerCommandStartDebugging.DebugText: String;
var
s: String;