IDCS5 Win K2Vector<IPMFont::FontProtection> question
i have code several places in project:
k2vector<ipmfont::fontprotection>* protectionlist = font -> getprotection();
k2vector<ipmfont::fontprotection>::iterator iter;
for(iter = protectionlist -> begin(); iter != protectionlist -> end(); ++iter)
{
// stuff...
}
delete protectionlist;
this code modeled after sample code found in snpinspectfontmgr.cpp sample snippet:
k2vector<ipmfont::fontprotection> *fontprotection = font->getprotection();
k2vector<ipmfont::fontprotection>::iterator iter;
bool16 dumpinfo = !(fontprotection->size() == 1 && fontprotection->front() ==ipmfont::knormal) ;
(iter = fontprotection->begin(); iter != fontprotection->end(); ++iter)
{
// stuff...
}
delete fontprotection;
the problem when include "delete protectionlist" line of code linker error, wit:
error lnk2019: unresolved external symbol "public: void __thiscall k2internals::k2vectorbase<enum ipmfont::fontprotection,class k2allocator<enum ipmfont::fontprotection> >::docleanup(void)"
if leave out "delete fontprotection" line of code plugin compiles , links without errors, large number of leaks when run it, , after several hours of careful, step-by-step, line-by-line debugging, have isolated leaks missing delete call.
does know doing wrong here?
tia!
john
i found problem.
for of required use k2vector, please advised there k2vector.tpp file should include in code. has handful of additional member functions k2vector may call. suspect when protectionlist calls destructor, there call 1 of functions.
i added line code:
#include "k2vector.tpp"
and linker error disappeared.
for record, quick search of sdk documentation , k2vector.h header makes no mention of additional file. discovered needed when made close inspection of snippet , discovered inclusion @ time.
More discussions in InDesign SDK
adobe
Comments
Post a Comment