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

View File

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