fix: improper lifetime for *Arm7tdmi ptr in Bus

*Arm7tdmi ptr is now assigned one scope up so that it lives as least
as long as Bus does
This commit is contained in:
2022-04-21 07:56:17 -03:00
parent 85e8ca9146
commit 75ba9a4bf9
3 changed files with 7 additions and 3 deletions

View File

@@ -80,6 +80,8 @@ pub fn main() anyerror!void {
const paths = .{ .bios = bios_path, .rom = rom_path, .save = save_path };
var cpu = try Arm7tdmi.init(alloc, &scheduler, paths);
defer cpu.deinit();
cpu.bus.attach(&cpu);
cpu.fastBoot();
// Initialize SDL Audio