diltsman
Mechanical
- Oct 5, 2007
- 2
I'm learning NX Open in Unigraphics NX 4. Whenever I use a function that returns a vector the plugin crashes when the vector goes out of scope. Some of the code I'm working with is:
When geometry goes out of scope, the plugin crashes with the following output to the log:
I'm confused as to why this does not work and was wondering if anyone could point out what I'm missing and how to fix it. Thanks.
Code:
for(NXOpen::SketchCollection::iterator i = sketches->begin(); i != sketches->end(); ++i)
{
log->WriteLine("\nIteration over this sketch.");
(*i)->initialize();
log->WriteLine((*i)->Name());
(*i)->Activate(NXOpen::Sketch::ViewReorientTrue);
std::vector<NXOpen::NXObject *> geometry = (*i)->GetAllGeometry();
}
When geometry goes out of scope, the plugin crashes with the following output to the log:
Code:
*** EXCEPTION: INTERNAL ERROR in line 2180 of O:\ugnx402\ip2\src\syss\error\ind\error.cxx at Fri Oct 05 10:44:03 2007 Mountain Daylight Time
+++ Breakpoint hit, possible use of uninitialized variable?
[ 1] 097A5EE9 dbgdel\operator delete Line 52 +0x99 (Test1)
[ 2] 097A273C xmemory\std::allocator<NXOpen::NXObject *>::deallocate Line 132 +0x2c (Test1)
[ 3] 097A2671 vector\std::vector<NXOpen::NXObject *,std::allocator<NXOpen::NXObject *> >::begin Line 797 +0x41 (Test1)
[ 4] 097A25FB vector\std::vector<NXOpen::NXObject *,std::allocator<NXOpen::NXObject *> >::~vector<NXOpen::NXObject *,std::allocator<NXOpen::NXObject *> > Line 389 +0x2b (Test1)
[ 5] 097BFCE7 test1\ufusr Line 57 +0x3c7 (Test1)
[ 6] 20362036 (libsyss)
[ 7] 2036318E (libsyss)
[ 8] 203FF997 (libsyss)
[ 9] 2490DCB0 (libpartmodl)
[10] 2490E0D0 (libpartmodl)
[11] 27913394 (libcamsint)
[12] 2013149D (libuginitint)
[13] 00EE26F7 (libugui)
[14] 00EE2BC7 (libugui)
[15] 00EE2D02 (libugui)
[16] 00EE2D78 (libugui)
[17] 00EE9EA2 (libugui)
[18] 00E51705 (libugui)
[19] 01A0CEF3 (windowsui)
[20] 01A0D08A (windowsui)
[21] 02AA03CB ()
>>>> INTERNAL ERROR caught in file "O:\ugnx402\ip2\src\syss\no\ind\lmldr.c" at line number 1002
>>>> INTERNAL ERROR caught in file "O:\ugnx402\ip2\src\syss\shar\ind\sys.c" at line number 1160
>>>> INTERNAL ERROR caught in file "O:\ugnx402\ip2\src\partmodl\no\ind\ufexit_ruf.c" at line number 537
I'm confused as to why this does not work and was wondering if anyone could point out what I'm missing and how to fix it. Thanks.