OSDN Git Service

[Fix] ダングリング参照に陥る不具合を修正した
authorHourier <66951241+Hourier@users.noreply.github.com>
Sat, 3 Jun 2023 11:33:20 +0000 (20:33 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Sat, 3 Jun 2023 11:33:20 +0000 (20:33 +0900)
src/grid/grid.cpp

index 3053312..d87a38e 100644 (file)
@@ -701,8 +701,8 @@ void update_flow(PlayerType *player_ptr)
 
         /* Now process the queue */
         while (!que.empty()) {
-            /* Extract the next entry */
-            const auto &[ty, tx] = que.front();
+            // 参照で受けるとダングリング状態になるのでコピーする.
+            const auto [ty, tx] = que.front();
             que.pop();
 
             /* Add the "children" */