diff options
| author | 2017-07-21 11:47:41 +1000 | |
|---|---|---|
| committer | 2017-07-21 11:47:41 +1000 | |
| commit | 05e84dccc04849857ebc4460084bdafc872d5815 (patch) | |
| tree | f20a0a1f88d6ee1cedec9f8b2861b09acb6c0ada /src/emu/debug/debugcpu.cpp | |
| parent | 431879ef2b675540cc3987d90b4d069a49854897 (diff) | |
* Make XML file a class of its own managed with smart poitners
* Save/restore a little more of Cocoa debugger state
Diffstat (limited to 'src/emu/debug/debugcpu.cpp')
| -rw-r--r-- | src/emu/debug/debugcpu.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index dfc581d478b..e682cbdafc6 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -226,8 +226,8 @@ bool debugger_cpu::comment_save() bool comments_saved = false; // if we don't have a root, bail - util::xml::data_node *const root = util::xml::data_node::file_create(); - if (root == nullptr) + util::xml::file::ptr const root = util::xml::file::create(); + if (!root) return false; // wrap in a try/catch to handle errors @@ -269,19 +269,17 @@ bool debugger_cpu::comment_save() osd_file::error filerr = file.open(m_machine.basename(), ".cmt"); if (filerr == osd_file::error::NONE) { - root->file_write(file); + root->write(file); comments_saved = true; } } } catch (emu_exception &) { - root->file_free(); return false; } // free and get out of here - root->file_free(); return comments_saved; } @@ -301,11 +299,11 @@ bool debugger_cpu::comment_load(bool is_inline) return false; // wrap in a try/catch to handle errors - util::xml::data_node *const root = util::xml::data_node::file_read(file, nullptr); + util::xml::file::ptr const root = util::xml::file::read(file, nullptr); try { // read the file - if (root == nullptr) + if (!root) throw emu_exception(); // find the config node @@ -342,13 +340,10 @@ bool debugger_cpu::comment_load(bool is_inline) catch (emu_exception &) { // clean up in case of error - if (root != nullptr) - root->file_free(); return false; } - // free the parser - root->file_free(); + // success! return true; } |
