🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.misc
Article #305

Re: Out Of Resources. Any idea why?

#305
From: Maarten Wiltink
Date: Mon, 10 Dec 2001 21:25
44 lines
2404 bytes
Boefje wrote in message <287dc9c0.0112101002.6cbc2cb@posting.google.com>...
>I use the next code to display a score. The score is a bitmap,
>returned by function ScoreBitmap. The bitmap is a standard true color
>(24-bits) bitmap.
>
>;------------------------------------------------------------
>
>procedure TForm1.DisplayScore(ai_Team ,ai_Score : integer);
>var TmpBmp : TBitmap;
>begin
>  TmpBmp := TBitmap.Create;

Assign a value to "TmpBmp".


>  TmpBmp.Width := ImageScore1.Width;
>  TmpBmp.Height := ImageScore1.Height;
>  TmpBmp := ScoreBitmap(ai_Score,TmpBmp.Width,TmpBmp.Height);

Assign a different value to "TmpBmp".


>  ImageScore1.Picture.Bitmap.FreeImage; { usefull?}
>  ImageScore1.Picture.Bitmap.Dormant; { usefull?}
>  ImageScore1.Picture.Bitmap.ReleaseHandle; { usefull?}
>  ImageScore1.Picture.Bitmap := TmpBmp;
>  TmpBmp.Free;

Free ONE bitmap.


>end;
>
>;------------------------------------------------------------
>
>After displaying the score many times, I get out of resources
>(EOutOfResources). This can only be caused by the created bitmaps. But
>I do not understand why. Please explain.


Perhaps freeing the first (locally allocated) bitmap would help.

Groetjes,
Maarten Wiltink
Technical Details
Message-ID: <9v398s$it0$1@news1.xs4all.nl>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!195.86.7.162!newsfeed.wirehub.nl!transit.news.xs4all.nl!not-for-mail
References: <287dc9c0.0112101002.6cbc2cb@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1043cf,74d708b07592566d
X-Google-Attributes: gid1043cf,public
X-Google-Thread: 10baee,74d708b07592566d
X-Google-Attributes: gid10baee,public
X-Google-ArrivalTime: 2001-12-10 13:25:50 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!195.86.7.162!newsfeed.wirehub.nl!transit.news.xs4all.nl!not-for-mail
From: "Maarten Wiltink" <maarten@kittensandcats.net>
Newsgroups: comp.lang.pascal.delphi.misc,borland.public.delphi.objectpascal
Subject: Re: Out Of Resources. Any idea why?
Date: Mon, 10 Dec 2001 22:25:46 +0100
Organization: Kittens & Cats, Inc.
Lines: 47
Message-ID: <9v398s$it0$1@news1.xs4all.nl>
References: <287dc9c0.0112101002.6cbc2cb@posting.google.com>
Reply-To: "Maarten Wiltink" <mfw@dds.nl>
NNTP-Posting-Host: kittensandcats.xs4all.nl
X-Trace: news1.xs4all.nl 1008019548 19360 213.84.46.174 (10 Dec 2001 21:25:48 GMT)
X-Complaints-To: abuse@xs4all.nl
NNTP-Posting-Date: 10 Dec 2001 21:25:48 GMT
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3