Skip to content

Commit 231ce43

Browse files
committed
ensure doom cart frees memory
1 parent 61c814b commit 231ce43

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main/doom_cart.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,18 @@ class DoomCart : public Cart {
99
public:
1010
explicit DoomCart(const Cart::Config& config)
1111
: Cart(config) {
12+
// Need to free the romdata used by most carts since doom uses a lot of
13+
// memory for its own data.
14+
BoxEmu::get().deinitialize_memory();
1215
handle_video_setting();
1316
init();
1417
}
1518

1619
virtual ~DoomCart() override {
1720
deinit();
21+
// Now that doom is deinitialized, we can reallocate the memory used by most
22+
// carts
23+
BoxEmu::get().initialize_memory();
1824
}
1925

2026
// cppcheck-suppress uselessOverride

0 commit comments

Comments
 (0)