Merge pull request #78 from lishoujun/develop

add null check to playerNotificationManager and player on Destroy
This commit is contained in:
Stefan Schüller 2018-12-31 08:36:23 +01:00 committed by GitHub
commit 44034a8a41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -118,11 +118,13 @@ public class VideoPlayerService extends Service {
public void onDestroy() {
Log.v(TAG, "onDestroy...");
playerNotificationManager.setPlayer(null);
player.release();
player = null;
if (playerNotificationManager != null) {
playerNotificationManager.setPlayer(null);
}
if (player != null) {
player.release();
player = null;
}
super.onDestroy();
}