Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #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
  #2 (permalink)  
Old 06-23-2007
dwayne's Avatar
dwayne dwayne is offline
ZeroC Staff
 
Name: Dwayne Boone
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Jan 2005
Location: St. John's, Newfoundland
Posts: 138
Ice servants must be allocated on the heap. Please see this FAQ for a complete explanation.
Reply With Quote
  #3 (permalink)  
Old 06-23-2007
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,762
Also, can you please check your private messages and get back to us?
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
object id with category can't be a template parameter? Yunqiao Yin Bug Reports 1 06-09-2006 08:27 AM
How to release object. laotee Help Center 12 08-29-2005 11:48 PM
how to add servant class yanhbo Help Center 1 08-19-2005 03:47 AM
Object Factories and object initialisation Nis Baggesen Help Center 1 09-30-2004 07:40 AM
Object Factory enzo Help Center 2 03-17-2004 01:29 PM


All times are GMT -4. The time now is 07:46 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.