1. Kaz Nishimura
  2. dmolist

Commits

Kaz Nishimura  committed 8cf5458

Changed to create the About box in the function scope.

  • Participants
  • Parent commits 9b41958
  • Branches default

Comments (0)

Files changed (2)

File src/MainFormUnit.cpp

View file
 #include <dshow.h>
 #include <wmsdk.h>
 #include <commctrl.h>
+#include <boost/scoped_ptr.hpp>
 #include <algorithm>
 #include <iterator>
 #include <cassert>
 }
 
 void __fastcall TMainForm::AboutActionExecute(TObject *Sender) {
-    if (AboutBox == 0)
-        AboutBox = new TAboutBox(0);
-    AboutBox->ShowModal();
+    boost::scoped_ptr<TAboutBox> AboutBox1(new TAboutBox(0));
+    AboutBox1->ShowModal();
 }
 
 void __fastcall TMainForm::ListView1Compare(TObject *Sender, TListItem *Item1,

File src/dmolist.cpp

View file
         Application->Initialize();
         Application->MainFormOnTaskBar = true;
         Application->CreateForm(__classid(TMainForm), &MainForm);
-        Application->CreateForm(__classid(TAboutBox), &AboutBox);
         Application->Run();
     } catch (Exception &exception) {
         Application->ShowException(&exception);