Updated the way module are initialized

It's safer and prevent a bug when initialisation fails


Former-commit-id: a04f18e18f2d9db11ec595a9b8096c2792b39641
This commit is contained in:
Lynix
2014-02-21 11:13:14 +01:00
parent 3f4b3aeef5
commit fd958fd9ac
9 changed files with 86 additions and 57 deletions

View File

@@ -12,11 +12,15 @@
bool NzCore::Initialize()
{
if (s_moduleReferenceCounter++ != 0)
if (s_moduleReferenceCounter > 0)
{
s_moduleReferenceCounter++;
return true; // Déjà initialisé
}
s_moduleReferenceCounter++;
NazaraNotice("Initialized: Core");
return true;
}