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
|
@ -185,7 +185,7 @@ public:
|
|||
Bit32u getFirstFreeClust(void);
|
||||
bool directoryBrowse(Bit32u dirClustNumber, direntry *useEntry, Bit32s entNum, Bit32s start=0);
|
||||
bool directoryChange(Bit32u dirClustNumber, direntry *useEntry, Bit32s entNum);
|
||||
std::unique_ptr<imageDisk> loadedDisk;
|
||||
std::shared_ptr<imageDisk> loadedDisk;
|
||||
bool created_successfully;
|
||||
private:
|
||||
Bit32u getClusterValue(Bit32u clustNum);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue