几何尺寸与公差论坛------致力于产品几何量公差标准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:33 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】memory allocation errors

memory allocation errors
memory allocation errors
i'm currently using dd_vc6.dll of 30th may with visual studio .net, and am getting crashes on repeat loads-i.e. the first file loads ok (and all instances of dwgdirect classes are destructed), but later ones crash, but it seems a little more complicated than that. i've therefore run using boundschecker, and it reports a number of cases of using free on a pointer to memory allocated by new (the precise error is "allocation conflict: attempting to call free on pointer 0x9133308, that was allocated by global_operator_new."). i'm not able to verify this since i don't have access to source code, but it might be worth checking if there is an issue. i'm using code with minimal changes from the sample code for classes such as exsystemservices, although the code for interpreting the data is different.

are you using new operator to create dd objects or createobject() function?
sergey slezkin

i've only been reading dwg files, so haven't been creating new objects, except for things like odgepoint2darray used to get at the data, which i simply declare (i.e. on the heap), and one or two cases where i have oddbobjectid objects as members of classes instantiated with new or used in an std::set. i've left classes such as exsystemservices more-or-less as they are, and they make some use of new, but i suspect i wasn't using the relevant parts anyway (presumably the code for loading raster images etc. is only used for rendering?).

it's difficult to discuss the problem without ability to reproduce it...
some time ago a bug was fixed which occured if odinitialize() / od uninitialize() were called multiple times. maybe your build contains this bug. does your application call these functions once?
sergey slezkin
i am experiencing the same problem. has anyone been able to fix this problem? i am creating multiple service and calling multiple odinitialize because i have one for loading dwg files and another one for saving dwg files. could this be the problem?
thanks in advance
see
sergey slezkin
it doesn't have to do with odinitialize because i put a break point there and it doesn't execute on the odinitialize at all. the really odd thing about this is what i was able to make one project setting to work without any heap problem. however other project settings still causes the heap problems.
odinitialize() must be called once at least.
depending on project settings you need to use correct dd libraries (md/ml/mt debug/release) and correct ms run-time ones.
sergey slezkin
i think i may have solved the problem. the problem was because i was linking the release mode dll in debug mode. that was why it was trying to call a release mode "free".
here is another request. can we rename the debug dll's such that they have "dbg" at the beginning of the file name (i.e. dbg_dd_dd.dll). this is what most developers are doing and makes linking much easier.
thanks
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】library linking errors in xcode 1.5 yang686526 DirectDWG 0 2009-05-06 04:46 PM
【转帖】help please - link errors yang686526 DirectDWG 0 2009-05-05 12:06 PM
【转帖】compile errors when deriving a class from oddbdxffiler yang686526 DirectDWG 0 2009-05-04 06:00 PM
【转帖】[翻译] metaprogramming with autocad (二) - 精华帖集合 yang686526 ObjectARX(VB.NET/C#) 0 2009-04-29 05:02 PM


所有的时间均为北京时间。 现在的时间是 12:41 PM.


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