几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-05-06, 05:36 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】memory leak in setplottype

memory leak in setplottype?
memory leak in setplottype?
hi,
i thought i had found a memory leak in oddbplotsettingsvalidator::setplottype, when running with dd2.0.3, and was advised to upgrade to 2.2. this i have done, but still get the same problem. the code i have isolated it to is as follows, in my cview class, when the user selects 'print'. i have trimmed this routine down so it now does nothing other than demonstrate the problem.
bool cmyview:nprepareprinting(cprintinfo* pinfo)
{
oddbobjectid idlayout = oddbblocktablerecordptr(m_pdb->getactivelayoutbtrid().safeopenobject())->getlayoutid();
oddblayoutptr playout = idlayout.safeopenobject();
oddbplotsettings *pplotsettings = playout.get();
oddbplotsettingsvalidatorptr m_pvalidator = m_pdb->appservices()->plotsettingsvalidator();
playout->upgradeopen();
if (!m_pvalidator.isnull()) m_pvalidator->setplottype(pplotsettings, oddbplotsettings::kextents);
return 0;
}
if i comment out the second last line (the one calling setplottype) there is no memory leak. if i leave it in, i get 3 blocks leaked, of 12, 70 and 20 bytes.
so presumably there is either a leak in that routine, or it's allocating something i should be releasing, but don't know about.
any suggestions?
regards
ali smith
could you test your code with mfcapp, for example
code:
void cdwgview:neditacisconversion()
{
oddbobjectid idlayout = oddbblocktablerecordptr(getdocument()->m_pdb->getactivelayoutbtrid().safeopenobject())->getlayoutid();
oddblayoutptr playout = idlayout.safeopenobject();
oddbplotsettings *pplotsettings = playout.get();
oddbplotsettingsvalidatorptr m_pvalidator = getdocument()->m_pdb->appservices()->plotsettingsvalidator();
playout->upgradeopen();
if (!m_pvalidator.isnull()) m_pvalidator->setplottype(pplotsettings, oddbplotsettings::kextents);
}
i test it with newly created file and call convertacis command (i change oneditacisconversion body for test purposes). it is possible that memory leaks are not in plot functionality, but in entity rendering. try to change kextents to kdisplay - it prevent extents calculation.
i cannot reproduce memory leaks with newly created file, and there is no 70 bytes allocation inside setplottype. please, attach your test file also.
i tried it in odamfcapp and it seems to work fine, no leak. in my own app, there is no problem if i use kdisplay, but i do get the leak if i use kextents. i have attached the dwg file i'm working with.
attached files (180.5 kb, 4 views)

i have checked your file with mfcapp and found nothing. are your application based on mfcapp or on vectorizeex sample?
also you can try set breakpoint to memory allocation with condition askedmemory == 70 and check stack position.
my app is based on mfcapp. where do i set the breakpoint for the memory allocation?
dd alloc module :
allocdll_export void* odrxalloc(size_t s)
{
return ::malloc( s );
}
or inside ::malloc( s );
last edited by sslezkin; 20th december 2006 at 08:07 amfff">.
unfortunately i don't have dd_alloc source.
i reproduced the leak in odamfcapp. we'll take care about it.
sergey slezkin
ok, i reproduce it in mfcapp static project only. something wrong with deallocation of loaded static modules.
last edited by sslezkin; 24th december 2006 at 11:54 pmfff">.
fixed, will be available with next release. fix is not very complex, so if somebody need it, please, ask for instructions (changes are inside of toolkit code)
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】memory leak in oda 2.1.01 yang686526 DirectDWG 0 2009-05-06 05:35 PM
【转帖】memory leak dwgdirect 2.0.2 yang686526 DirectDWG 0 2009-05-06 05:35 PM
【转帖】has gdi leak yang686526 DirectDWG 0 2009-05-05 11:46 AM
【转帖】gdi resource leak 9workaround0 yang686526 DirectDWG 0 2009-05-05 11:10 AM
【转帖】does this file cause a leak yang686526 DirectDWG 0 2009-05-04 08:02 PM


所有的时间均为北京时间。 现在的时间是 05:36 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多