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

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】memory exception when writing many block insertions (http://www.dimcax.com/hust/showthread.php?t=17168)

yang686526 2009-05-06 05:35 PM

【转帖】memory exception when writing many block insertions
 
memory exception when writing many block insertions
memory exception when writing many block insertions
hi,
it looks a null pointer exception when writing a dxf/dwg file with more than approx. 26000 block insertions of the same definition.
the call stack shows odmemorystreamimpl<odstaticrxobject<odstreambuf>>: :addpage is where the crash occurs after a call to oddbblockreferenceptr::setblocktablerecord.
it is possible to write out more than 26000 blocks, just as long as there are no more than ~26000 of one particular block type.
you may be wondering how we came to writing so many blocks... in our program, these are single elevation points with symbols turned on. the workaround for our user is to turn off symbols before writing to autocad, then they get exported as autocad point entities.
ps. this is dwgdirectc++ 2.04.01
thanks!
erle
the problem is with undo. you should add these multiple inserts inside transaction.
use oddbdatabase::starttransaction(), oddbdatabase::endtransaction().
vladimir


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