高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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
|