查看单个帖子
旧 2009-05-06, 05:35 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)