Browse Source

Absturz beim initialisieren des Spiels behoben

Kolja Strohm 4 năm trước cách đây
mục cha
commit
7cc16b395c
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  1. 10 0
      StickmanWorldOnline/Spiel.cpp

+ 10 - 0
StickmanWorldOnline/Spiel.cpp

@@ -7,6 +7,8 @@
 // Konstruktor
 Spiel::Spiel()
 {
+    zKlients = 0;
+    psqldb = 0;
     nextId = 0;
     isRunning = 0;
     log = 0;
@@ -123,6 +125,10 @@ Spiel::~Spiel()
         zuletztBenutzterTunnel->release();
     if( zuletztBenutzteUmlenkung )
         zuletztBenutzteUmlenkung->release();
+    if( zKlients )
+        zKlients->release();
+    if( zAccounts )
+        zAccounts->release();
 }
 
 // nicht constant
@@ -154,12 +160,16 @@ void Spiel::setTempPfad( char *pfad )
 // call 3.5
 void Spiel::setAccounts( int anzahl, Array< int > *zAccounts )
 {
+    if( this->zAccounts )
+        this->zAccounts->release();
     this->zAccounts = zAccounts->getThis();
     spielerAnzahl = anzahl;
 }
 // call 4
 void Spiel::setKlients( int anzahl, RCArray< SSKlientV > *zKlients )
 {
+    if( this->zKlients )
+        this->zKlients->release();
     this->zKlients = zKlients->getThis();
 }
 // call 5