summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-12-22 14:58:57 +0100
committerunknown <joreland@mysql.com>2004-12-22 14:58:57 +0100
commit17ec146c6c124d91a3c749da538b55bbd119c956 (patch)
tree757735d21233dbf15188e2fdd0729a6388f71884
parent4e6fb94d86a5262fe425983d5e3952b29716b960 (diff)
downloadmariadb-git-17ec146c6c124d91a3c749da538b55bbd119c956.tar.gz
ndb - Fix bug in backward compatility code (for our test programs)
ndb/src/ndbapi/Ndbinit.cpp: Fix bug in backward compatility code (for our test programs)
-rw-r--r--ndb/src/ndbapi/Ndbinit.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp
index e1af7bd4cc5..a11dd842495 100644
--- a/ndb/src/ndbapi/Ndbinit.cpp
+++ b/ndb/src/ndbapi/Ndbinit.cpp
@@ -204,14 +204,6 @@ Ndb::~Ndb()
TransporterFacade::instance()->close(theNdbBlockNumber, theFirstTransId);
}
- if (global_ndb_cluster_connection != 0) {
- theNoOfNdbObjects--;
- if(theNoOfNdbObjects == 0){
- delete global_ndb_cluster_connection;
- global_ndb_cluster_connection= 0;
- }
- }//if
-
// if (theSchemaConToNdbList != NULL)
// closeSchemaTransaction(theSchemaConToNdbList);
while ( theConIdleList != NULL )
@@ -249,6 +241,19 @@ Ndb::~Ndb()
delete theImpl;
+ /**
+ * This needs to be put after delete theImpl
+ * as TransporterFacade::instance is delete by global_ndb_cluster_connection
+ * and used by theImpl
+ */
+ if (global_ndb_cluster_connection != 0) {
+ theNoOfNdbObjects--;
+ if(theNoOfNdbObjects == 0){
+ delete global_ndb_cluster_connection;
+ global_ndb_cluster_connection= 0;
+ }
+ }//if
+
/**
* This sleep is to make sure that the transporter
* send thread will come in and send any