am 046b72fc: Merge "fix a possible deadlock when removing a layer and destroying a client"

* commit '046b72fc5d93aae3b47b88b9f6683512d01d75d0':
  fix a possible deadlock when removing a layer and destroying a client