<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=big5>
<STYLE></STYLE>
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FONT-SIZE: 10pt; COLOR: #000000; PADDING-TOP: 15px; FONT-FAMILY: Arial"
bgColor=#ffffff leftMargin=0 topMargin=0 CanvasTabStop="true" acc_role="text"
name="Compose message area">
<DIV>Sorry missed a few lines of my call stack:</DIV>
<DIV>> msvcr71d.dll!_free_dbg_lk(void * pUserData=0x01978540, int
nBlockUse=1) Line 1154 +
0x3b C<BR> msvcr71d.dll!_free_dbg(void * pUserData=0x01978540,
int nBlockUse=1) Line 1070 +
0xd C<BR> msvcr71d.dll!operator delete(void *
pUserData=0x01978540) Line 54 +
0x10 C++<BR> msvcr71d.dll!operator delete[](void *
p=0x01978540) Line 21 +
0x9 C++<BR> watershed.exe!vnl_c_vector_dealloc(void *
v=0x01978540, int __formal=360, int __formal=360) Line 398 +
0xf C++<BR> watershed.exe!vnl_c_vector<unsigned
int>::deallocate(unsigned int * p=0x01978540, int n=360) Line 468 +
0xf C++<BR> watershed.exe!vnl_vector<unsigned
int>::destroy() Line 282 +
0x12 C++<BR> watershed.exe!vnl_vector<unsigned
int>::~vnl_vector<unsigned int>() Line
275 C++<BR> watershed.exe!itk::Array<unsigned
int>::~Array<unsigned int>() Line 73 + 0x8 C++</DIV>
<DIV> </DIV>
<DIV>Albert<BR></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=mailto:alberth+itk@ece.ubc.ca
href="mailto:alberth+itk@ece.ubc.ca">Albert Huang</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=mailto:insight-users@itk.org
href="mailto:insight-users@itk.org">insight-users@itk.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, February 10, 2007 12:36
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Array deallocation error</DIV>
<DIV><BR></DIV>
<DIV>Dear experts</DIV>
<DIV> </DIV>
<DIV>I am trying to use itkArray (ITK 3.0.1) inside a class member
function as below:</DIV>
<DIV> unsigned int ParametersDimension = 100;</DIV>
<DIV> typedef Array<unsigned int>
CountType;<BR> CountType derivative_count = CountType(
ParametersDimension );<BR> derivative_count.Fill(
NumericTraits<ITK_TYPENAME CountType::ValueType>::Zero );<BR></DIV>
<DIV>However the program crash with the following error at the end of the
function at runtime in Visual C++ 2003 Debug mode:</DIV>
<DIV> watershed.exe!vnl_c_vector<unsigned
int>::deallocate(unsigned int * p=0x019cc998, int n=360) Line 468 +
0xf C++<BR> watershed.exe!vnl_vector<unsigned
int>::destroy() Line 282 +
0x12 C++<BR> watershed.exe!vnl_vector<unsigned
int>::~vnl_vector<unsigned int>() Line
275 C++<BR> watershed.exe!itk::Array<unsigned
int>::~Array<unsigned int>() Line 73 + 0x8 C++<BR></DIV>
<DIV>I am wondering if I am missing something obvious or if something is out
of whack here.</DIV>
<DIV> </DIV>
<DIV>Thanks =)</DIV>
<DIV>Albert</DIV></BLOCKQUOTE></BODY></HTML>