Article View: be.comp.programming
Article #13452MFC: CPropertySheet::RemovePage veroorzaakt geheugenlek
From: Covan Vision Systems
Date: Fri, 13 Jul 2001 06:27
Date: Fri, 13 Jul 2001 06:27
35 lines
2323 bytes
2323 bytes
Hi, In an application we've written we have a dialog based MFC application based on the CPropertySheet class. We are dynamically adding and removing pages while the the dialog is displayed. If the property pages we're adding and removing contain controls (i've tried it with buttons and treecontrols), then we have a memory leak: when I constantly add and remove pages, thus always returning to a same initial state, the application consumes more and more memory. It has nothing to do with the CPropertyPage derived objects themselves. I added several integer members to them, to make the memoryfootprint of the object bigger, but this doesn't cause the memory leak to be bigger. However, when I fill the dialog (by using the dialog editor of visual studio 6.0) with a lot of buttons, then the memory leak is getting bigger. I've added no functionality to the buttons, and not to the CPropertyPage derived class, except for one button with which I can add and remove pages to the CPropertySheet derived dailogbox. Thus it looks like MFC doesn't destroy the dialog template, or the controls on it. The page we're removing is NOT the active page. I've tried explicitly callling destroywindow on the propertypage that gets removed but this does not work neither. The only functionality the application has, is adding and removing CPropertyPage derived objects, so the memoryleak can not be caused by anything else. Does anyone have an idea what can be wrong and how to solve it ????? Thanks, Serge Desmedt
Technical Details
Message-ID:
<3b4e94a1.852085@news.skynet.be>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!195.238.2.15!skynet.be!louie!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcea4,5e91f0b43d1560e3,start X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2001-07-12 23:24:59 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!195.238.2.15!skynet.be!louie!not-for-mail From: bartl@covan.be (Covan Vision Systems) Newsgroups: be.comp.programming Subject: MFC: CPropertySheet::RemovePage veroorzaakt geheugenlek Date: Fri, 13 Jul 2001 06:27:43 GMT Organization: Covan Vision Systems Reply-To: bartl@covan.be Message-ID: <3b4e94a1.852085@news.skynet.be> X-Newsreader: Forte Free Agent 1.21/32.243 Lines: 35 NNTP-Posting-Host: 194.78.207.44 X-Trace: 995005495 reader1.news.skynet.be 62193 194.78.207.44 X-Complaints-To: abuse@skynet.be