axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Lin <glenn....@yahoo.com>
Subject Question about operator delete
Date Thu, 13 Jul 2006 02:34:26 GMT
Hi everybody, I am Glenn. As a freshman, all suggestions will be warm welcome. ^_^
   
  Now I am in charge of a part of project which based on axis-c and I am confronted with some
problems when deleting object in the program.
   
  Could you please help read the codes below first and give me some suggestions:
   
  ******************************************
  #include <axis/AxisUserAPI.hpp>
#include <axis/AxisUserAPIArrays.hpp>
using namespace std;
  AXIS_CPP_NAMESPACE_USE
int main(int argc, char **argv)
{
 xsd__string_Array *sss[2];
 sss[0] = new xsd__string_Array();
 sss[1] = new xsd__string_Array();
 ::delete sss[0];
 delete sss[1]; //stop in this line
 return 0;
}
  ******************************************
   
  It is both ok for building and just running it. But when it comes to debug, an excepion
named "Unhandled exception at 0x7c921230 in testDelete.exe: User breakpoint" will be thrown
in this line: "delete sss[1];", then the process will stop at this segment: 
  //C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\crt\src\free.c
 void __cdecl _free_base (void * pBlock) {
          ......  
  }
//It maybe stop at different segments according to differenct condition.
   
  If you select "continue", the process will exit.
   
  However, the statment using "::delete" is all right.
   
  What confused me is the different performance between "::delete" and "delete".
   
  As C++ standard specified, key word "::" is option for delete operater, that means it should
have same result when use "::delete" and "delete", but it didn't work on in this place. Meanwhile,
I didn't find any overload of delete operater.
  I find out that all classes which used "xsd__" as prefix have the same problem, as far as
I know, they all public extends form "Axis_Array" and use this tag "__declspec(dllexport)"
for export.
   
  I would like to know whether you met this problem before and how to solve it.
   
  My develop environment is Window XP sp2, Microsoft Development Enviroment 2003 Version 7.1.3088
and axis-c-1.6b-Win32-trace-bin.
   
  Thank you very much!
   
  yours Glenn

 		
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2ยข/min
or less.
Mime
View raw message