mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 11:27:07 +00:00
Explicitly release server.lock file when shutdown the server. (#3619)
Previously, this relied on PHP itself to release locks during the resource destructor phase during process exit, but sometimes it doesn't for god knows what reason. This change makes the lock file get explicitly released before the process dies.
This commit is contained in:
parent
d343187e58
commit
df76c02e7a
@ -289,6 +289,14 @@ namespace pocketmine {
|
||||
|
||||
echo Terminal::$FORMAT_RESET . PHP_EOL;
|
||||
|
||||
if(!flock(\pocketmine\LOCK_FILE, LOCK_UN)){
|
||||
critical_error("Failed to release the server.lock file.");
|
||||
}
|
||||
|
||||
if(!fclose(\pocketmine\LOCK_FILE)){
|
||||
critical_error("Could not close server.lock resource.");
|
||||
}
|
||||
|
||||
exit($exitCode);
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ parameters:
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$fp of function flock expects resource, resource\\|false given\\.$#"
|
||||
count: 3
|
||||
count: 4
|
||||
path: ../../../src/pocketmine/PocketMine.php
|
||||
|
||||
-
|
||||
@ -105,6 +105,11 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/PocketMine.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$fp of function fclose expects resource, resource\\|false given\\.$#"
|
||||
count: 1
|
||||
path: ../../../src/pocketmine/PocketMine.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$buffer of method pocketmine\\\\nbt\\\\NBTStream\\:\\:readCompressed\\(\\) expects string, string\\|false given\\.$#"
|
||||
count: 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user