mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-18 10:45:27 +02:00
Fix some reference counters (memleak) (#8981)
Fix some reference counters (memleak) Map::dispatchEvent: Allocation safety using references
This commit is contained in:
@@ -246,7 +246,7 @@ void Schematic::placeOnMap(ServerMap *map, v3s16 p, u32 flags,
|
||||
for (it = modified_blocks.begin(); it != modified_blocks.end(); ++it)
|
||||
event.modified_blocks.insert(it->first);
|
||||
|
||||
map->dispatchEvent(&event);
|
||||
map->dispatchEvent(event);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -135,7 +135,7 @@ treegen::error spawn_ltree(ServerEnvironment *env, v3s16 p0,
|
||||
event.type = MEET_OTHER;
|
||||
for (auto &modified_block : modified_blocks)
|
||||
event.modified_blocks.insert(modified_block.first);
|
||||
map->dispatchEvent(&event);
|
||||
map->dispatchEvent(event);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user