Detach in API destructor

develop
Petr Mrázek 2010-03-16 22:12:05 +01:00
parent ff27cdb2f3
commit df4de4a333
2 changed files with 365 additions and 361 deletions

@ -187,6 +187,8 @@ API::API (const string path_to_xml)
API::~API() API::~API()
{ {
// FIXME: call all finishread* methods here
Detach();
delete d; delete d;
} }
@ -1439,6 +1441,8 @@ bool API::Attach()
bool API::Detach() bool API::Detach()
{ {
if(!d->p)
return false;
if (!d->p->detach()) if (!d->p->detach())
{ {
return false; return false;