No need to crash if we are deleted after not getting far enough to allocate the
configuration buffers. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33122 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8c393635e2
commit
9b0a2ab24c
@ -271,6 +271,13 @@ Device::Device(Object *parent, int8 hubAddress, uint8 hubPort,
|
||||
|
||||
Device::~Device()
|
||||
{
|
||||
delete fDefaultPipe;
|
||||
|
||||
if (fConfigurations == NULL) {
|
||||
// we didn't get far in device setup, so everything below is unneeded
|
||||
return;
|
||||
}
|
||||
|
||||
// Destroy open endpoints. Do not send a device request to unconfigure
|
||||
// though, since we may be deleted because the device was unplugged
|
||||
// already.
|
||||
@ -305,7 +312,6 @@ Device::~Device()
|
||||
}
|
||||
|
||||
free(fConfigurations);
|
||||
delete fDefaultPipe;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user