Expose the shared pointer instead of the raw pointer in the resource manager and rewrite the custom sheets list to use a vector instead of manual memory management
In particular, this should fix a segmentation fault in the sound system caused by the resource manager pulling a resource that's in use.
This commit is contained in:
@@ -1089,7 +1089,7 @@ void save_scenario(bool rename) {
|
||||
if(spec_scen_g.is_old) {
|
||||
spec_scen_g.convert_sheets();
|
||||
for(size_t i = 0; i < spec_scen_g.numSheets; i++) {
|
||||
sf::Image sheet = spec_scen_g.sheets[i].copyToImage();
|
||||
sf::Image sheet = spec_scen_g.sheets[i]->copyToImage();
|
||||
fs::path tempPath = tempDir/"temp.png";
|
||||
sheet.saveToFile(tempPath.string());
|
||||
std::ostream& pic_out = scen_file.newFile("scenario/graphics/sheet" + std::to_string(i) + ".png");
|
||||
|
Reference in New Issue
Block a user