[
https://issues.apache.org/jira/browse/CB-7204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14135064#comment-14135064
]
ASF GitHub Bot commented on CB-7204:
------------------------------------
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.
> Race condition when hiding and showing spinner
> ----------------------------------------------
>
> Key: CB-7204
> URL: https://issues.apache.org/jira/browse/CB-7204
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin SplashScreen
> Environment: iOS
> Reporter: Andrey Kurdyumov
> Priority: Minor
> Attachments: Screenshot 2014-07-27 at 19.31.09.png
>
>
> I have application which show spinner on resume to indicate loading activity
> for the application.
> When quickly show and hide application there appears race condition which
> result in the application crash.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)