trichview.com

trichview.support




Re: Memoryleaks??


Return to index


Author

Message

Sergey Tkachenko

Posted: 09/28/2004 20:55:25


You must not delete picture returned by GetCurrentPictureInfo - it is still

owned by RichViewEdit1.


Your application is not crashed because you assign grPicture = NULL before

calling delete, so this delete does nothing.


You can safely remove

   grPicture = NULL;

   delete grPicture;


>

> The following code I use:

>

> if(RichViewEdit1->CurItemStyle == rvsPicture)

> {

>   AnsiString s;

>   int iTag;

>   TGraphic *grPicture;

>   TRVVAlign VAlign;

>   RichViewEdit1->GetCurrentPictureInfo(s, grPicture, VAlign, iTag);

>

>   Panel1->Caption = grPicture->Width;

>

>   grPicture = NULL;

>   delete grPicture;

> }

>

> At the end I delete grPicture, so I don't get memoryleaks...







Powered by ABC Amber Outlook Express Converter