Unrefing a device that has never been ref'd will also destroy it.

This commit is contained in:
Jonas 'Sortie' Termansen 2011-11-17 23:14:45 +01:00
parent 708643d0f2
commit 15329187b9
1 changed files with 1 additions and 1 deletions

View File

@ -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()