OvercastNetwork / SportBukkit

CraftBukkit and Bukkit modifications that improve stability and add new features
100 stars 85 forks source link

Call Plugin.onDisable before disabling the plugin #123

Closed jedediah closed 9 years ago

jedediah commented 9 years ago

Give plugins a chance to clean up before disabling them

ttaylorr commented 9 years ago

Looks fine to me :+1:

tonybruess commented 9 years ago

Looks good, what's the reasoning behind this?

jedediah commented 9 years ago

There are a lot of things a plugin is not allowed to do when it's disabled, so just disabling it without warning makes it hard to avoid doing those things. For example, a background thread that schedules tasks on the main thread, which disabled plugins are not allowed to do. If onDisable is called after disabling, then there is no way to stop the thread in time.

tonybruess commented 9 years ago

Cool, looks good to merge.

On Thu, Nov 20, 2014 at 8:48 PM, Jedediah Smith notifications@github.com wrote:

There are a lot of things a plugin is not allowed to do when it's disabled, so just disabling it without warning makes it hard to avoid doing those things. For example, a background thread that schedules tasks on the main thread, which disabled plugins are not allowed to do. If onDisable is called after disabling, then there is no way to stop the thread in time.

Reply to this email directly or view it on GitHub: https://github.com/OvercastNetwork/SportBukkit/pull/123#issuecomment-63924157