| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * This file is part of the Adblock Plus, | 2 * This file is part of the Adblock Plus, |
| 3 * Copyright (C) 2006-2012 Eyeo GmbH | 3 * Copyright (C) 2006-2012 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 // Clear native proxy | 305 // Clear native proxy |
| 306 if (nativeProxy) | 306 if (nativeProxy) |
| 307 { | 307 { |
| 308 unregisterReceiver(connectionReceiver); | 308 unregisterReceiver(connectionReceiver); |
| 309 clearConnectionProxy(); | 309 clearConnectionProxy(); |
| 310 } | 310 } |
| 311 | 311 |
| 312 sendBroadcast(new Intent(BROADCAST_STATE_CHANGED).putExtra("enabled", false) ); | 312 sendBroadcast(new Intent(BROADCAST_STATE_CHANGED).putExtra("enabled", false) ); |
| 313 | 313 |
| 314 // Stop proxy server | 314 // Stop proxy server |
| 315 proxy.close(); | 315 if (proxy != null) |
|
Felix Dahlke
2012/11/28 08:35:38
When can the proxy be null here? When an exception
Andrey Novikov
2013/02/22 08:31:32
Not only on exception. I do not know why but it's
Felix Dahlke
2013/02/22 08:35:03
So onDestroy is sometimes called without onCreate
| |
| 316 proxy.close(); | |
| 316 | 317 |
| 317 // Stop engine if not in interactive mode | 318 // Stop engine if not in interactive mode |
| 318 AdblockPlus.getApplication().stopEngine(false); | 319 AdblockPlus.getApplication().stopEngine(false); |
| 319 | 320 |
| 320 // Release service lock | 321 // Release service lock |
| 321 stopForeground(true); | 322 stopForeground(true); |
| 322 | 323 |
| 323 Log.i(TAG, "Service stopped"); | 324 Log.i(TAG, "Service stopped"); |
| 324 } | 325 } |
| 325 | 326 |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 721 @Override | 722 @Override |
| 722 public void log(int level, Object obj, String message) | 723 public void log(int level, Object obj, String message) |
| 723 { | 724 { |
| 724 if (level <= logLevel) | 725 if (level <= logLevel) |
| 725 { | 726 { |
| 726 Log.println(7 - level, obj != null ? obj.toString() : TAG, message); | 727 Log.println(7 - level, obj != null ? obj.toString() : TAG, message); |
| 727 } | 728 } |
| 728 } | 729 } |
| 729 } | 730 } |
| 730 } | 731 } |
| OLD | NEW |