Changeset 21032

Show
Ignore:
Timestamp:
02/13/08 17:51:31 (7 months ago)
Author:
patrick
Message:

Work around a crash-on-exit problem that I see now that remote run-time
reconfiguration tends to be active by default.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/vrjuggler/vrj/Kernel/CocoaWrapper.mm

    r20974 r21032  
    207207void CocoaWrapper::threadEnded() 
    208208{ 
    209    NSAutoreleasePool* pool = *mThreadPool; 
    210    [pool release]; 
    211    *mThreadPool = nil; 
    212 
    213  
    214 
     209   try 
     210   { 
     211      // XXX: Accessing the thread-specific data can fail in some cases. It is 
     212      // not clear to me why this can happen, but it seems to be tied to 
     213      // using remote run-time reconfiguration. It may be related to omniORB 
     214      // creating threads of its own, but I am not sure.  -PH 2/13/2008 
     215      NSAutoreleasePool* pool = *mThreadPool; 
     216      [pool release]; 
     217      *mThreadPool = nil; 
     218   } 
     219   catch (vpr::BadCastException& ex) 
     220   { 
     221      std::cerr << "NOTE: Failed to release reference to NSAutoreleasePool:\n" 
     222                << ex.getExtendedDescription() << std::endl; 
     223   } 
     224
     225 
     226