X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3fa0976a57287847af094e4b4f1f6f6a1dc7893e..606a31780538fa7af291003d7797d62d55cccb56:/demos/dbbrowse/doc.cpp diff --git a/demos/dbbrowse/doc.cpp b/demos/dbbrowse/doc.cpp index b4f8f4e7c4..59acac8256 100644 --- a/demos/dbbrowse/doc.cpp +++ b/demos/dbbrowse/doc.cpp @@ -33,7 +33,7 @@ //---------------------------------------------------------------------------------------- //-- Some Global Vars for all Files (extern in ?.h needed) ------------------------------- // Global structure for holding ODBC connection information -struct DbStuff DbConnectInf; +wxDbConnectInf DbConnectInf; //---------------------------------------------------------------------------------------- wxConfigBase *p_ProgramCfg; // All Config and Path information wxLogTextCtrl *p_LogBook; // All Log messages @@ -63,7 +63,8 @@ MainDoc::~MainDoc() // ---------------------------------------------------------- // -E-> The Tree Controls take to long to close : Why ?? // ---------------------------------------------------------- - // wxMessageBox("-I-> end Doc"); + delete ft_Doc; + ft_Doc = NULL; p_TabArea->Show(FALSE); // Deactivate the Window p_PageArea->Show(FALSE); // Deactivate the Window p_PgmCtrl = NULL; @@ -108,6 +109,8 @@ bool MainDoc::OnInitView() wxBitmap *p_FolderClose = new wxBitmap("PgmCtrl"); //, wxBITMAP_TYPE_BMP_RESOURCE); // BJO20000115 //--------------------------------------------------------------------------------------- p_TabArea->AddTab(p_PgmCtrl,"PgmCtrl",p_FolderClose); + delete p_FolderClose; // Memory leak + p_FolderClose = NULL; //--------------------------------------------------------------------------------------- // now create "output" window //--------------------------------------------------------------------------------------- @@ -133,8 +136,9 @@ bool MainDoc::OnInitView() p_Splitter->Initialize(p_TabArea); p_Splitter->SplitHorizontally(p_TabArea,p_PageArea,Sash); //--------------------------------------------------------------------------------------- - if (!OnInitODBC()) - return FALSE; + // if (!OnInitODBC()) + // return FALSE; + OnInitODBC(); //--------------------------------------------------------------------------------------- Temp0.Printf(_("-I-> MainDoc::OnInitView() - End - %d DSN's found"),i_DSN); p_MainFrame->SetStatusText(Temp0, 0); @@ -164,7 +168,7 @@ bool MainDoc::OnInitODBC() // The key will be removed after sorting wxString KeyString; //--------------------------------------------------------------------------------------- - while(GetDataSource(DbConnectInf.Henv, Dsn, sizeof(Dsn), DsDesc, sizeof(DsDesc))) + while(wxDbGetDataSource(DbConnectInf.Henv, Dsn, sizeof(Dsn), DsDesc, sizeof(DsDesc))) { i_DSN++; // How many Dsn have we ? KeyString.Printf("%s%c%s",Dsn, sep, DsDesc); @@ -204,7 +208,7 @@ bool MainDoc::OnInitODBC() (db_Br+i)->pDoc = this; (db_Br+i)->i_Which = i; } - if (SQLFreeEnv(&DbConnectInf.Henv) != SQL_SUCCESS) // BJO20000125 + if (SQLFreeEnv(DbConnectInf.Henv) != SQL_SUCCESS) // BJO20000125 / MJ10777.20000309 : no & { // Error freeing environment handle }