Use shared_ptr to prevent double free on imageDisk
Also, replacing unique_ptr with shared_ptr makes it unnecessary to move a pointer when swapping boot disks; moving shared_ptr would lead to inconsistent internal state. Fixes: #94
This commit is contained in:
parent
70a1f9f0d1
commit
5f282f6015
4 changed files with 23 additions and 42 deletions
|
@ -81,8 +81,8 @@ void incrementFDD(void);
|
|||
|
||||
#define MAX_DISK_IMAGES (2 + MAX_HDD_IMAGES)
|
||||
|
||||
extern std::array<std::unique_ptr<imageDisk>, MAX_DISK_IMAGES> imageDiskList;
|
||||
extern std::array<std::unique_ptr<imageDisk>, MAX_SWAPPABLE_DISKS> diskSwap;
|
||||
extern std::array<std::shared_ptr<imageDisk>, MAX_DISK_IMAGES> imageDiskList;
|
||||
extern std::array<std::shared_ptr<imageDisk>, MAX_SWAPPABLE_DISKS> diskSwap;
|
||||
|
||||
extern Bit32s swapPosition;
|
||||
extern Bit16u imgDTASeg; /* Real memory location of temporary DTA pointer for fat image disk access */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue