![]() |
What am I doing wrong? (Memory leak and DLL exte) |
Post Reply
|
| Author | |
JoseAngel
Groupie
Joined: 21 March 2006 Location: Spain Status: Offline Points: 35 |
Post Options
Thanks(0)
Quote Reply
Topic: What am I doing wrong? (Memory leak and DLL exte)Posted: 11 June 2008 at 11:55am |
|
uploads/20080611_115432_extension.zip is a small solution with two projects, one extension DLL that exports a very simple MyToolbar class and a MFC client application that uses that dll for to create one toolbar. (The .sln file is in extension directory)
After executing two or three times the application, I can hear a Windows crash sound sound and Visual Studio (2008) show me the next memory leaks information: Detected memory leaks! Dumping objects -> {473} normal block at 0x00CF6130, 20 bytes long. Data: < > 00 00 00 00 00 00 00 00 00 00 00 00 CD CD CD CD c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtempl.h(401) : {472} normal block at 0x00CF60F0, 4 bytes long. Data: <8 $ > 38 C5 24 00 c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtempl.h(401) : {470} normal block at 0x00CF5F68, 4 bytes long. Data: <8 $ > 38 C5 24 00 c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtempl.h(401) : {467} normal block at 0x00CF5F28, 4 bytes long. Data: < > 00 00 00 00 c:\users\jose angel\documents\visual studio 2008\projects\xtreme toolkitpro v12.0.0\source\commandbars\xtpdockbar.cpp(39) : {466} client block at 0x00CF5E78, subtype c0, 112 bytes long. a CXTPDockBar object at $00CF5E78, 112 bytes long c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtempl.h(401) : {464} normal block at 0x00CF5E38, 4 bytes long. Data: < > 00 00 00 00 c:\users\jose angel\documents\visual studio 2008\projects\xtreme toolkitpro v12.0.0\source\commandbars\xtpdockbar.cpp(39) : {463} client block at 0x00CF5D88, subtype c0, 112 bytes long. a CXTPDockBar object at $00CF5D88, 112 bytes long c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxtempl.h(401) : {461} normal block at 0x00CF5D48, 4 bytes long. Data: < > 00 00 00 00 c:\users\jose angel\documents\visual studio 2008\projects\xtreme toolkitpro v12.0.0\source\commandbars\xtpdockbar.cpp(39) : {460} client block at 0x00CF5C98, subtype c0, 112 bytes long. a CXTPDockBar object at $00CF5C98, 112 bytes long c:\users\jose angel\documents\visual studio 2008\projects\xtreme toolkitpro v12.0.0\source\commandbars\xtpdockbar.cpp(39) : {457} client block at 0x00CF5BE8, subtype c0, 112 bytes long. a CXTPDockBar object at $00CF5BE8, 112 bytes long c:\users\jose angel\documents\visual studio 2008\projects\xtreme toolkitpro v12.0.0\source\commandbars\xtpcommandbars.cpp(261) : {455} client block at 0x00CF5AF8, subtype c0, 56 bytes long. a CCmdTarget object at $00CF5AF8, 56 bytes long |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 June 2008 at 1:30pm |
|
Hi,
Obviously problem in your Create method.
use
CXTPToolBar * pToolBar = GetCommandBars()->Add("Name", xtpBarTop);or CXTPToolBar * pToolBar = GetCommandBars()->Add("Name", xtpBarTop, RUNTIME_CLASS(CMyToolbar) ); |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
JoseAngel
Groupie
Joined: 21 March 2006 Location: Spain Status: Offline Points: 35 |
Post Options
Thanks(0)
Quote Reply
Posted: 12 June 2008 at 7:08am |
|
Or even
myToolbar = new CMyToolbar; myToolbar->Create(GetCommandBars()); Actually my project is bigger and it creates correctly all the objects. Finally I found the source of memory leaks: One of the pluggins of my application are linked with the ANSI version of MFC, and my application is Unicode. Reading the document: http://support.microsoft.com/kb/167929/en-us/ I undertstand now that these memory leaks are false ones. Thank you. |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 June 2008 at 6:30am |
|
ok :)
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |