fixed memleak in debugger from Vincent

git-svn-id: trunk@4876 -
This commit is contained in:
mattias 2003-12-05 08:39:53 +00:00
parent eb5c0a7d5b
commit 9ef4196e0f
3 changed files with 42 additions and 13 deletions

View File

@ -627,20 +627,23 @@ begin
// Check for strings
ResultInfo := GetGDBTypeInfo(S);
if (ResultInfo = nil)
or (ResultInfo.Kind <> skPointer)
then Exit;
if (ResultInfo = nil) then Exit;
Val(AResult, addr, e);
if e <> 0 then Exit;
try
if (ResultInfo.Kind <> skPointer) then Exit;
Val(AResult, addr, e);
if e <> 0 then Exit;
if Addr = 0
then AResult := 'nil';
if Addr = 0
then AResult := 'nil';
S := Lowercase(ResultInfo.TypeName);
if (S = 'character')
or (S = 'ansistring')
then AResult := '''' + GetText(Pointer(addr)) + '''';
S := Lowercase(ResultInfo.TypeName);
if (S = 'character')
or (S = 'ansistring')
then AResult := '''' + GetText(Pointer(addr)) + '''';
finally
ResultInfo.Free;
end;
end;
function TGDBMIDebugger.GDBJumpTo(const ASource: String;
@ -2066,6 +2069,9 @@ initialization
end.
{ =============================================================================
$Log$
Revision 1.39 2003/12/05 08:39:53 mattias
fixed memleak in debugger from Vincent
Revision 1.38 2003/08/15 14:28:48 mattias
clean up win32 ifdefs

View File

@ -66,6 +66,7 @@ type
protected
public
constructor Create;
destructor Destroy; override;
property Name: String read FName;
property GDBType: TGDBType read FGDBType;
property Location: TGDBFieldLocation read FLocation;
@ -112,6 +113,7 @@ type
public
constructor Create;
constructor CreateFromValues(const AValues: String);
destructor Destroy; override;
property Ancestor: String read FAncestor;
property Arguments: TGDBTypes read FArguments;
property Fields: TGDBFields read FFields;
@ -311,6 +313,12 @@ begin
FLocation := flPublic;
end;
destructor TGDBField.Destroy;
begin
if FGDBType<>nil then FreeAndNil(FGDBType);
inherited Destroy;
end;
{ TGDBFields }
constructor TGDBFields.Create;
@ -550,8 +558,17 @@ begin
end;
end;
destructor TGDBType.Destroy;
begin
if FResult<>nil then FreeAndNil(FResult);
if FArguments<>nil then FreeAndNil(FArguments);
if FFields<>nil then FreeAndNil(FFields);
if FMembers<>nil then FreeAndNil(FMembers);
{ TGDBPType }
inherited;
end;
{ TGDBPTypes }
constructor TGDBTypes.Create;
begin
@ -598,6 +615,9 @@ end;
end.
{ =============================================================================
$Log$
Revision 1.3 2003/12/05 08:39:53 mattias
fixed memleak in debugger from Vincent
Revision 1.2 2003/05/23 14:12:51 mattias
implemented restoring breakpoints

View File

@ -23,7 +23,7 @@ end;
procedure TGraphicsObject.Changing;
begin
Assert(False, Format('Trace:[TgraphicsObject.Changed] %s', [ClassName]));
Assert(False, Format('Trace:[TgraphicsObject.Changing] %s', [ClassName]));
if Assigned(FOnChanging) then FOnChanging(Self);
end;
@ -46,6 +46,9 @@ end;
{ =============================================================================
$Log$
Revision 1.5 2003/12/05 08:39:53 mattias
fixed memleak in debugger from Vincent
Revision 1.4 2003/12/02 12:25:17 micha
try: gdi memory leak fix for pen