mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Fix memory corruption issue when replacing sectors.
This commit is contained in:
@@ -41,7 +41,8 @@ void readSectorsFromFile(SectorSet& sectors, const Geometry& geometry,
|
||||
Bytes data(geometry.sectorSize);
|
||||
inputFile.read((char*) data.begin(), geometry.sectorSize);
|
||||
|
||||
Sector* sector = sectors.get(track, head, sectorId) = new Sector();
|
||||
std::unique_ptr<Sector>& sector = sectors.get(track, head, sectorId);
|
||||
sector.reset(new Sector);
|
||||
sector->status = Sector::OK;
|
||||
sector->logicalTrack = sector->physicalTrack = track;
|
||||
sector->logicalSide = sector->physicalSide = head;
|
||||
|
||||
Reference in New Issue
Block a user