android: Of course you can't put null in a LinkedBlockingQueue. Shrug. Fixes a shutdown crash.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 43m31s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 43m31s
This commit is contained in:
@@ -63,6 +63,7 @@ public class TildeFriendsActivity extends Activity {
|
|||||||
private float touch_down_y;
|
private float touch_down_y;
|
||||||
private boolean ready = false;
|
private boolean ready = false;
|
||||||
private boolean loaded = false;
|
private boolean loaded = false;
|
||||||
|
private boolean shutting_down = false;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
log("Calling system.loadLibrary().");
|
log("Calling system.loadLibrary().");
|
||||||
@@ -274,7 +275,7 @@ public class TildeFriendsActivity extends Activity {
|
|||||||
log_thread = new Thread(new Runnable() {
|
log_thread = new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
while (true) {
|
while (!s_activity.shutting_down) {
|
||||||
try {
|
try {
|
||||||
String message = log_queue.take();
|
String message = log_queue.take();
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
@@ -335,8 +336,9 @@ public class TildeFriendsActivity extends Activity {
|
|||||||
protected void onDestroy()
|
protected void onDestroy()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
shutting_down = true;
|
||||||
if (log_queue != null) {
|
if (log_queue != null) {
|
||||||
log_queue.put(null);
|
log_queue.put("Goodbye.");
|
||||||
}
|
}
|
||||||
log_thread.join();
|
log_thread.join();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
Reference in New Issue
Block a user