diff options
author | Shane Freeder <[email protected]> | 2019-03-26 00:55:29 +0000 |
---|---|---|
committer | Shane Freeder <[email protected]> | 2019-03-26 00:56:16 +0000 |
commit | 364a53e37aef3fd1bcc0e7a2ef2ada050085d43c (patch) | |
tree | cdbd3571ddafe0b74cb232030317c0522caa728c | |
parent | e8bbfbfddf682fd10cee5f039c11fdacf70eafed (diff) | |
download | Paper-364a53e37aef3fd1bcc0e7a2ef2ada050085d43c.tar.gz Paper-364a53e37aef3fd1bcc0e7a2ef2ada050085d43c.zip |
Ensure that TimedEventExecutor timings are closed (Fixes #1918)
pre this, any event handler firing an exception would leave the timings
open, causing the timings stack to be corrupted
-rw-r--r-- | Spigot-API-Patches/0004-Timings-v2.patch | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Spigot-API-Patches/0004-Timings-v2.patch b/Spigot-API-Patches/0004-Timings-v2.patch index bd78e3c315..8b700dea58 100644 --- a/Spigot-API-Patches/0004-Timings-v2.patch +++ b/Spigot-API-Patches/0004-Timings-v2.patch @@ -1,4 +1,4 @@ -From 24d273e696fc58bf34246300ee6199f5dbb1f7ba Mon Sep 17 00:00:00 2001 +From f7754e7d136f3f3a688bc358e4e53cba5f1d44fb Mon Sep 17 00:00:00 2001 From: Aikar <[email protected]> Date: Mon, 29 Feb 2016 18:48:17 -0600 Subject: [PATCH] Timings v2 @@ -169,7 +169,7 @@ index 000000000..8e0cd40e8 +} diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java new file mode 100644 -index 000000000..68f7866e1 +index 000000000..933ecf9bd --- /dev/null +++ b/src/main/java/co/aikar/timings/TimedEventExecutor.java @@ -0,0 +1,83 @@ @@ -251,9 +251,9 @@ index 000000000..68f7866e1 + executor.execute(listener, event); + return; + } -+ timings.startTiming(); -+ executor.execute(listener, event); -+ timings.stopTiming(); ++ try (Timing ignored = timings.startTiming()){ ++ executor.execute(listener, event); ++ } + } +} diff --git a/src/main/java/co/aikar/timings/Timing.java b/src/main/java/co/aikar/timings/Timing.java |