Inv(#1020): add code to monitor clean-up by GTK
I am still suspicious the cleanup mechanism for child widgets works as expected... But right now, we can't verify that, since on shutdown we get an assertion failure from ld.so "dl-close.c: 762: _dl_close: Assertion `map->l_init_called' failed!" Seems we're loading the GUI plugin not properly
This commit is contained in:
parent
dd9f34e93a
commit
12f1165765
2 changed files with 34 additions and 0 deletions
|
|
@ -127,6 +127,8 @@ namespace panel {
|
|||
|
||||
namespace {
|
||||
_Fmt childID("Chld-%02d");
|
||||
|
||||
int instanceCnt = 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -138,9 +140,37 @@ namespace panel {
|
|||
{
|
||||
signal_clicked().connect(
|
||||
mem_fun(*this, &ChildEx::onClicked));
|
||||
|
||||
++instanceCnt;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////TICKET #1020 : verification code for instance management
|
||||
ChildEx::~ChildEx()
|
||||
{
|
||||
--instanceCnt;
|
||||
if (instanceCnt > 0)
|
||||
cout << " 💀 still "<<instanceCnt<<" children to kill...";
|
||||
else
|
||||
if (instanceCnt == 0)
|
||||
cout << "+++ Success: all children are dead..."<<endl;
|
||||
else
|
||||
cout << "### ALARM ###"<<endl
|
||||
<< "instanceCnt == "<<instanceCnt <<endl;
|
||||
}
|
||||
|
||||
void
|
||||
__verifyDeadChildren()
|
||||
{
|
||||
if (instanceCnt == 0)
|
||||
cout << "+++ Success: all children are dead..."<<endl;
|
||||
else
|
||||
cout << "### ALARM ###"<<endl
|
||||
<< "instanceCnt == "<<instanceCnt <<endl;
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////TICKET #1020 : verification code for instance management
|
||||
|
||||
|
||||
void
|
||||
ChildEx::onClicked()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,11 +56,15 @@ namespace model{
|
|||
|
||||
public:
|
||||
ChildEx();
|
||||
~ChildEx();
|
||||
|
||||
private:
|
||||
void onClicked();
|
||||
};
|
||||
|
||||
void __verifyDeadChildren();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Dockable panel to hold timeline widget(s).
|
||||
|
|
|
|||
Loading…
Reference in a new issue