|
|
|
|||||
|
I need to use the data which i get from ICE,but i want Keep it until i finish the job,but garbage collector will delete it when the flow finish.
Or maybe ican shut garbage collector down. can you help me? TKS. |
|
|||||
|
No,It's not bug.
for example: client use callback send msg to server and receive some info in class CallbackReceiverI : public CallbackReceiver{}, when CallbackReceiverI finsih, the data will be delete by ICE,i guess it's garbage collector ,but i don't want put my deal fuction in the class CallbackReceiverI : public CallbackReceiver{}, i want to keep them in memery until i delete it. of course, i can copy it in class CallbackReceiverI : public CallbackReceiver{}, but it's too slow,so i want keep the primary data as well. TKS.
__________________
|
|
||||||
|
Quote:
Also, the only class instances that the collector deals with are those that are part of a cycle. Any class instance that is not part of a cycle is reclaimed when its reference count drops to zero, that is, when the last smart pointer to the instance goes out of scope. The garbage collector guarantees that it will collect only instances that are no longer reachable by any smart pointer in your program. If you have an instance you would like to hang onto, the reason almost certainly is that you are not keeping a smart pointer for the instance in scope that would keep it's reference count non-zero. This has nothing to do with the collector--it is simply a matter of how you use smart pointers. Do not keep C++ pointers or references to a class instance in your program. If you do, they will point into outer space once the last smart pointer to the instance goes out of scope. Quote:
I suggest that you have a look at the "Smart Pointers for Classes" section in the Chapter 6 of the Ice Manual. If the issue you are seeing is indeed caused by the garbage collector, we'll need a code example that demonstrates the problem. Cheers, Michi. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Garbage Collection Troubles | Nis Baggesen | Help Center | 8 | 02-15-2006 11:46 AM |
| Incorrect note about C++ garbage collector in documentation ? | chaukmean | Bug Reports | 1 | 11-28-2003 04:11 PM |