Use SafeStringStream instead of std::stringstream to try to fix random crashes on...
[dcpomatic.git] / src / tools / dcpomatic.cc
index 588fd5c486da54bd037cf2228bcaa05ceac4c448..c92f5b6cf8b182004a9879076dd5b2305db8fd20 100644 (file)
@@ -64,7 +64,6 @@
 using std::cout;
 using std::string;
 using std::wstring;
-using std::stringstream;
 using std::map;
 using std::make_pair;
 using std::list;
@@ -337,13 +336,12 @@ private:
 
        void file_changed (boost::filesystem::path f)
        {
-               stringstream s;
-               s << wx_to_std (_("DCP-o-matic"));
+               string s = wx_to_std (_("DCP-o-matic"));
                if (!f.empty ()) {
-                       s << " - " << f.string ();
+                       s += " - " + f.string ();
                }
                
-               SetTitle (std_to_wx (s.str()));
+               SetTitle (std_to_wx (s));
        }
        
        void file_new ()
@@ -392,7 +390,7 @@ private:
                        );
                
                int r;
-               while (1) {
+               while (true) {
                        r = c->ShowModal ();
                        if (r == wxID_OK && c->GetPath() == wxStandardPaths::Get().GetDocumentsDir()) {
                                error_dialog (this, _("You did not select a folder.  Make sure that you select a folder before clicking Open."));