Github user kant2002 commented on the pull request:

    
https://github.com/apache/cordova-plugin-splashscreen/pull/21#issuecomment-55702064
  
    When you are really fast this is not working. New view created before call 
to `[self destroyViews];` happens inside callback and application crash when it 
is executed second time. You could try it yourself, just run application and 
hide it during opening transition multiple times. 
    
    Basically this is what happens:
    ```
    // Pause
    // Resume
    [self createViews]
    [self destroyViews]
    // Pause
    // Resume
    [self createViews]
    [self destroyViews]
    ```
    
    where you expect following conditions
    ```
    // Pause
    // Resume
    [self createViews]
    // Pause
    // Resume
    [self createViews]
    [self destroyViews]
    [self destroyViews]
    ```
    
    I know that this is not proper fix, since it will potentially(?) cause 
memory leak during that condition (not remember fully now, but when I discover 
that I deep belief that memory will be leacked).
    To proper implement fix, I have to capture view which has to be destroyed 
inside callback that way if `[self createViews]` would be called and some 
handlers and views(?) would be overridden and leaked.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to