View Single Post
  #1 (permalink)  
Old 06-22-2007
russule russule is offline
Registered User
 
Name: Lei Chun
Organization: www.channelsoft.com.cn
Project: Conf
 
Join Date: Oct 2006
Posts: 32
Object* add(Object servant, Identity id),can the servant be static object?

Hi,
I did a test, wrote a server with Ice.3.2.0 in windows xp.

Code:
static confI* Inst()
	{
		static confI cb;
		return &cb;
	};
Code:
adapter->add(confI::Inst(), communicator()->stringToIdentity("conf"));
The server runs well, but when i closed it,it occurs excetion.

Debug Assertion Failed!
File:dbgheap.c
Line:1044
Expression:_CrtIsValidHeapPointer(pUserData)


When I didn't use the static object,
Code:
adapter->add(new confI,communicator()->stringToIdentity("conf"));
there was no exception occured.

the Object* add(Object servant, Identity id) function.
can the servant be the static object?
Thanks!
Reply With Quote