aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-09-24 19:05:28 +0200
committerGitHub <noreply@github.com>2019-09-24 19:05:28 +0200
commit26b39f1eae1f576669cbf49c6db94ef4ed8624df (patch)
treedd0a508d4d6987f2c667cbf342955f64ebbd02af /src/mapgen
parentd77ea764768f5cde9e8f0781356a67d723aa7609 (diff)
downloadminetest-26b39f1eae1f576669cbf49c6db94ef4ed8624df.tar.gz
minetest-26b39f1eae1f576669cbf49c6db94ef4ed8624df.tar.bz2
minetest-26b39f1eae1f576669cbf49c6db94ef4ed8624df.zip
Fix some reference counters (memleak) (#8981)
Fix some reference counters (memleak) Map::dispatchEvent: Allocation safety using references
Diffstat (limited to 'src/mapgen')
-rw-r--r--src/mapgen/mg_schematic.cpp2
-rw-r--r--src/mapgen/treegen.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mapgen/mg_schematic.cpp b/src/mapgen/mg_schematic.cpp
index 36f1dd76b..c1acbfd9d 100644
--- a/src/mapgen/mg_schematic.cpp
+++ b/src/mapgen/mg_schematic.cpp
@@ -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);
}
diff --git a/src/mapgen/treegen.cpp b/src/mapgen/treegen.cpp
index 4c351fcef..0d8af2851 100644
--- a/src/mapgen/treegen.cpp
+++ b/src/mapgen/treegen.cpp
@@ -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;
}