Browse Source

Ein paar kleine Fehler weniger

Kolja Strohm 6 years ago
parent
commit
393ba3fcf4

+ 5 - 2
KSGClient/Global/DLLDateien.cpp

@@ -43,8 +43,11 @@ HINSTANCE DLLDateien::ladeDLL( char *name, char *pfad )
 		}
 	}
 	HINSTANCE h = LoadLibrary( pfad );
-	if( !h )
-		return 0;
+    if( !h )
+    {
+        cs.unlock();
+        return 0;
+    }
 	DLLDatei *dll = new DLLDatei();
 	dll->name = new Text( name );
 	dll->handle = h;

+ 8 - 4
KSGClient/Global/Variablen.cpp

@@ -87,10 +87,18 @@ void releaseVariables()
 		registerClient = registerClient->release();
 	if( infoClient )
 		infoClient = infoClient->release();
+    if( chatClient )
+        chatClient->trenne( 1 );
+    if( cmProcessor )
+        cmProcessor = cmProcessor->release();
 	if( chatClient )
 		chatClient = chatClient->release();
 	if( anmeldungClient )
 		anmeldungClient = anmeldungClient->release();
+    if( spielClient )
+        spielClient->trenne();
+    if( smProcessor )
+        smProcessor = smProcessor->release();
 	if( spielClient )
 		spielClient = spielClient->release();
 	if( shopClient )
@@ -107,10 +115,6 @@ void releaseVariables()
 		hauptScreen = hauptScreen->release();
     if( mainClient )
         mainClient = mainClient->release();
-    if( cmProcessor )
-        cmProcessor = cmProcessor->release();
-    if( smProcessor )
-        smProcessor = smProcessor->release();
     KartenLeser::cleanUp();
 	if( bilder )
 	{

+ 1 - 0
KSGClient/NachLogin/Editor/Karte/KartenEditor.cpp

@@ -91,6 +91,7 @@ void KartenEditor::thread()
     nachLogin->setEditor( editorF->getThis() );
     aktion = 9;
     laden->setSichtbar( 0 );
+    editorF->setSichtbar();
 }
 
 void KartenEditor::setKarte( int id )

+ 4 - 0
KSGClient/NachLogin/NachLogin.cpp

@@ -41,6 +41,8 @@ NachLogin::~NachLogin()
 		schrift = schrift->release();
 	if( bildschirm )
 		bildschirm = bildschirm->release();
+    if( editor )
+        editor->release();
 }
 
 // nicht constant
@@ -122,6 +124,8 @@ void NachLogin::setSpielAufzeichnung( AufzeichnungV *video ) // Setzt die Spiel
 
 void NachLogin::setEditor( EditorV *editor ) // Setzt die Spiel Aufzeichnung
 {
+    if( this->editor )
+        this->editor->release();
     this->editor = editor;
 }
 

+ 4 - 4
KSGClient/NachLogin/Spiele/Spiel Auswahl/SpielAuswahl.cpp

@@ -250,10 +250,6 @@ void SpielDaten::Loader::thread()
             pf->insert( 0, "data/spiele/" );
             if( !pf->hat( ".ltdb/" ) )
             {
-                hauptScreen->lock();
-                if( sd->aAnimation )
-                    sd->aAnimation = sd->aAnimation->release();
-                hauptScreen->unlock();
                 LTDBDatei *add = new LTDBDatei();
                 add->setDatei( pf->getThis() );
                 add->leseDaten( 0 );
@@ -261,7 +257,11 @@ void SpielDaten::Loader::thread()
                 ad->ladeAnimation( add );
                 ad->setWiederhohlend( 1 );
                 ad->setFPS( 30 );
+                hauptScreen->lock();
+                if( sd->aAnimation )
+                    sd->aAnimation = sd->aAnimation->release();
                 sd->aAnimation = new Animation2D();
+                hauptScreen->unlock();
                 sd->aAnimation->setSize( 200, 100 );
                 sd->aAnimation->setPosition( 0, 0 );
                 sd->aAnimation->setAnimationDataZ( ad );