Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/CodeGuard/CodeGuard 32    [ Add a report in this area ]  
Report #:  66811   Status: Closed
GodeGuard Not fixed allocation Memory
Project:  C++Builder Build #:  11.0.2987.10779
Version:    11.2 Submitted By:   Kirill Andreev
Report Type:  Basic functionality failure Date Reported:  9/15/2008 10:34:43 PM
Severity:    Commonly encountered problem Last Updated: 6/15/2011 3:29:22 PM
Platform:    All versions Internal Tracking #:  
Resolution: Duplicate (Resolution Comments) Resolved in Build: :
Duplicate of:  29277
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 1
Description
When I dynamic create Object of TFileStream

TFileStream * f = new TFileStream1 ("img.bmp",fmOpenRead);

afrer close Application CodeGuard Not detected this memory leak


I try Create Chil class for TFileStream

class TFileStream1: public TFileStream {
  public :
  __fastcall TFileStream1(AnsiString  as, unsigned short w):TFileStream(as,w){}
  __fastcall virtual  ~TFileStream1() {
    OutputDebugString(AnsiString().sprintf("~TFileStream").c_str());
  }

and check  ~TFileStream1()  -- not be called
Steps to Reproduce:
1. Enable CodeGuard


2. type the code

class TFileStream1: public TFileStream {
  public :
  __fastcall TFileStream1(AnsiString  as, unsigned short w):TFileStream(as,w){}
  __fastcall virtual  ~TFileStream1() {
    OutputDebugString(AnsiString().sprintf("~TFileStream").c_str());
  }
};
//---------------------------------------------------------------------------
__fastcall TfmBitmap::TfmBitmap(TComponent* Owner)
  : TForm(Owner)
{
TFileStream * f = new TFileStream1 ("img.bmp",fmOpenRead);

}

3. Run and close Application
Workarounds
None
Attachment
None
Comments

Tomohiro Takahashi at 9/16/2008 12:15:47 AM -
Please see QC#29277.

CodeGuard can not detect memory leak which is allocated by Delphi(RTL/VCL) library.

Server Response from: ETNACODE01