aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-07-01 00:12:52 +0200
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-07-01 00:12:52 +0200
commit3620538812a9df490ace6b3adf8bd120b7a0027b (patch)
tree884483c7d6e9c903b1499a6b702cd1d8551f1fd0 /qtmips_machine
parent2408ca900657fdb81f85092a0612aeb6217fbe0f (diff)
downloadqtmips-3620538812a9df490ace6b3adf8bd120b7a0027b.tar.gz
qtmips-3620538812a9df490ace6b3adf8bd120b7a0027b.tar.bz2
qtmips-3620538812a9df490ace6b3adf8bd120b7a0027b.zip
Fix memory leakages which repeat during program operation.
There are some singletons left which are allocated/created during main window content population. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine')
-rw-r--r--qtmips_machine/core.cpp4
-rw-r--r--qtmips_machine/core.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/qtmips_machine/core.cpp b/qtmips_machine/core.cpp
index 96ae0ad..3255fbf 100644
--- a/qtmips_machine/core.cpp
+++ b/qtmips_machine/core.cpp
@@ -60,6 +60,10 @@ Core::Core(Registers *regs, MemoryAccess *mem_program, MemoryAccess *mem_data,
step_over_exception[EXCAUSE_INT] = false;
}
+Core::~Core() {
+ delete ex_default_handler;
+}
+
void Core::step(bool skip_break) {
cycle_c++;
emit cycle_c_value(cycle_c);
diff --git a/qtmips_machine/core.h b/qtmips_machine/core.h
index fd15315..dfa9261 100644
--- a/qtmips_machine/core.h
+++ b/qtmips_machine/core.h
@@ -72,6 +72,7 @@ class Core : public QObject {
public:
Core(Registers *regs, MemoryAccess *mem_program, MemoryAccess *mem_data,
unsigned int min_cache_row_size = 1, Cop0State *cop0state = nullptr);
+ ~Core();
void step(bool skip_break = false); // Do single step
void reset(); // Reset core (only core, memory and registers has to be reseted separately)