Safely shut down extension hooks.

Review Request #5318 — Created Jan. 24, 2014 and submitted

Information

Djblets
master

Reviewers

Safely shut down extension hooks.

It was possible to trigger shutting down an extension twice, which could
easily break hooks. Hooks assume they'll be initialized once and shut
down once, but this would break if extensions ever called shutdown on
themselves.

We now check an initialization state on the hook just to be sure before
we do any shutdown work.

Extensions wishing to shut down the hooks should now call
shutdown_hooks() instead of shutdown().

Unit tests pass.

david
  1. Looks good. Should this be backported to 0.7.x?

    1. I initially started writing this to fix Power Pack, but then realized Power Pack was doing something a bit more custom anyway. I don't think we need to backport it. If we backported for Power Pack (the only extension I know doing this right now), users would need to grab the latest Djblets/RB anyway.

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Loading...