Unrefing a device that has never been ref'd will also destroy it.
This commit is contained in:
parent
708643d0f2
commit
15329187b9
|
@ -40,7 +40,7 @@ namespace Sortix
|
|||
|
||||
void Device::Unref()
|
||||
{
|
||||
if ( --refcount == 0 ) { delete this; }
|
||||
if ( --refcount == 0 || refcount == SIZE_MAX ) { delete this; }
|
||||
}
|
||||
|
||||
void Device::Refer()
|
||||
|
|
Loading…
Reference in New Issue