jdg / MBProgressHUD

MBProgressHUD + Customizations
http://www.bukovinski.com/
MIT License
16.01k stars 3.56k forks source link

Check animation is finished on hide #440

Closed carloscabanero closed 5 years ago

carloscabanero commented 8 years ago

Fixes hide - show - hide race condition, holding the HUD on screen. Call "done" only when the animation has finished as the show cycle could have been restarted.

Steps to reproduce:

This is an easy fix although it was difficult to pinpoint. On Blink Shell we use MBProgressHUD as a way to show changes between terminals. We change the content of the HUD instead of creating a new instance, and a new show-hide cycle must start.

Thanks!

matej commented 6 years ago

Sorry for taking so long to get to this.

I'm afraid this change might lead to a different issue - one that was solved in 5ec046a by @yas375. We need a solution that would work in both cases.