Skip to content
This repository was archived by the owner on Nov 13, 2017. It is now read-only.

Commit 0460cdd

Browse files
committed
don't destroy SharedStorage to avoid interference with destruction of class_loader's static variables
1 parent d481e0b commit 0460cdd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

planning_interface/common_planning_interface_objects/src/common_objects.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,16 @@ struct SharedStorage
6161

6262
SharedStorage& getSharedStorage()
6363
{
64+
#if 0 // destruction of static storage interferes with static destruction in class_loader
65+
// More specifically, class_loader's static variables might be already destroyed
66+
// while being accessed again in the destructor of the class_loader-based kinematics plugin.
6467
static SharedStorage storage;
6568
return storage;
69+
#else // thus avoid destruction at all (until class_loader is fixed)
70+
static SharedStorage *storage = NULL;
71+
if (!storage) storage = new SharedStorage;
72+
return *storage;
73+
#endif
6674
}
6775
}
6876

0 commit comments

Comments
 (0)