高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】memory leaks when printing
memory leaks when printing
memory leaks when printing
hi,
i'm using the odamfcapp code to do printing in my own app, but am getting memory leaks when i bring up the page setup dialog and close it (3 leaks - 12,70 and 20 bytes). it seems to be in the call to setplottype that the memory is allocated, but i don't know what i have to do to release it? it also seems to happen during a call to setplotcfgname, (another 12, 70 and 20 bytes leaked), so it must be something about how i've set up the plotsettings stuff. but i can't get any further into the code to see what i've done wong. odamfcapp itself does not have this problem, so it must be something i've missed.
any thoughts from anyone?
regards
ali smith
hi,
i'll check it. what is used toolkit version ?
last edited by sslezkin; 14th december 2006 at 11:38 pmfff">.
i'm using v2.0.3.
thanks
ali
i recommend you to use our last release (2.2.0). i have fixed memory corruption bug in plot validator module and some significant defects also (invalid print preview generation and ...).
i cannot help you with memory leaks in your application. could you prepare small test to reproduce it with mfcapp ?
i will try to build with 2.2. i've been using 2.0.3, because when i built with 2.1 i kept getting crashes in the delete[] routine. i've now found that with 2.1 if i link in dd_alloc_dll.lib instead of using dd_vc2003md_alloc.lib it works fine. is this a known problem with 2.1?
now having got my app working under 2.1, i shall upgrade to 2.2 and see if i'm still ok, and if my memory leak also diappears. if not, i'll post a new message.
thanks for you help (so far!)
i need more information about delete crash in 2.1. can you describe steps to reproduce crash in mfcapp or prepare some code example?
ok, thanks.
well, this is a strange one, because it happens on my machine, but on my client's machine when he builds the app it doesn't happen. it's when i'm reading in a file and looking for blocks with particular attributes. when i find the block, i extract the attributes to a structure which is then added to an array for later use in the application. i've attached the code that extracts the attributes. what seems to happen is that the first time in it adds the first item to my carray, no problem. but next time in, it goes to add the next item, by expanding the array by one element in size. but when it's deleting the original buffer, having set up a new buffer with now the two items in it, it crashes in odrxfree(). i've also attached the call stack in case it might be of interest.
attached files (8.8 kb, 11 views)
you may just drop dd_alloc and insert your own odrxalloc/free functions, as described in
vladimir
|