aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2010-10-13 16:52:14 +0200
committerDavid 'Digit' Turner <digit@android.com>2010-10-13 16:52:14 +0200
commit73f31662e687ea96d579ce9dca45c640b930985f (patch)
tree8f1c7038d4dc4a42876509774bcccc9e6958036c
parent00fa926bdd4c7d169f1124b6029234dcc254bc1f (diff)
downloadexternal_qemu-73f31662e687ea96d579ce9dca45c640b930985f.zip
external_qemu-73f31662e687ea96d579ce9dca45c640b930985f.tar.gz
external_qemu-73f31662e687ea96d579ce9dca45c640b930985f.tar.bz2
emulator-ui: fix crash on exit
+ remove net_cleanup() call in qemu_main(). It is not needed since the corresponding function only deals with the virtual LAN management and was causing build issues on some machines. Change-Id: I63896b9886c59259f75025277601711b450b2c0d
-rw-r--r--android/ui-core-protocol.c3
-rw-r--r--framebuffer.c2
-rw-r--r--framebuffer.h6
-rw-r--r--qemu-timer-ui.c8
-rw-r--r--vl-android-ui.c12
5 files changed, 14 insertions, 17 deletions
diff --git a/android/ui-core-protocol.c b/android/ui-core-protocol.c
index fa1a31a..4da625c 100644
--- a/android/ui-core-protocol.c
+++ b/android/ui-core-protocol.c
@@ -185,10 +185,7 @@ android_core_audio_get_backend_name(int is_input, int index,
void
android_core_system_shutdown_request(void)
{
- /* Temporary implementation for the monolitic (core + ui) builds. */
-#if !defined(CONFIG_STANDALONE_UI)
qemu_system_shutdown_request();
-#endif // !CONFIG_STANDALONE_UI
}
int
diff --git a/framebuffer.c b/framebuffer.c
index adbebb3..966ced5 100644
--- a/framebuffer.c
+++ b/framebuffer.c
@@ -178,7 +178,7 @@ qframebuffer_poll( QFrameBuffer* qfbuff )
{
QFrameBufferExtra* extra = qfbuff->extra;
- if (extra->fb_poll)
+ if (extra && extra->fb_poll)
extra->fb_poll( extra->fb_opaque );
}
diff --git a/framebuffer.h b/framebuffer.h
index 9e99d26..b8c4580 100644
--- a/framebuffer.h
+++ b/framebuffer.h
@@ -76,14 +76,14 @@ qframebuffer_init( QFrameBuffer* qfbuff,
int rotation,
QFrameBufferFormat format );
-/* recompute phys_width_mm and phys_height_mm according to the emulated
+/* recompute phys_width_mm and phys_height_mm according to the emulated
* screen DPI settings */
extern void
qframebuffer_set_dpi( QFrameBuffer* qfbuff,
int x_dpi,
int y_dpi );
-/* alternative to qframebuffer_set_dpi where one can set the physical
+/* alternative to qframebuffer_set_dpi where one can set the physical
* dimensions directly in millimeters. for the record 1 inch = 25.4 mm */
extern void
qframebuffer_set_mm( QFrameBuffer* qfbuff,
@@ -94,7 +94,7 @@ qframebuffer_set_mm( QFrameBuffer* qfbuff,
* rectangle of the framebuffer pixels was updated and needs to be
* redrawn.
*/
-typedef void (*QFrameBufferUpdateFunc)( void* opaque, int x, int y,
+typedef void (*QFrameBufferUpdateFunc)( void* opaque, int x, int y,
int w, int h );
/* the Client::Rotate method is called to instruct the client that a
diff --git a/qemu-timer-ui.c b/qemu-timer-ui.c
index dfdbb9b..5a734b5 100644
--- a/qemu-timer-ui.c
+++ b/qemu-timer-ui.c
@@ -934,12 +934,6 @@ static void win32_rearm_timer(struct qemu_alarm_timer *t)
#endif /* _WIN32 */
-static void alarm_timer_on_change_state_rearm(void *opaque, int running, int reason)
-{
- if (running)
- qemu_rearm_alarm_timer((struct qemu_alarm_timer *) opaque);
-}
-
int init_timer_alarm(void)
{
struct qemu_alarm_timer *t = NULL;
@@ -982,7 +976,7 @@ int qemu_calculate_timeout(void)
{
/* XXX: use timeout computed from timers */
int64_t add;
- int64_t delta;
+ int64_t delta = 0;
/* Advance virtual time to the next event. */
{
/* Wait for either IO to occur or the next
diff --git a/vl-android-ui.c b/vl-android-ui.c
index 60df320..ad57cd6 100644
--- a/vl-android-ui.c
+++ b/vl-android-ui.c
@@ -547,6 +547,14 @@ static void nographic_update(void *opaque)
qemu_mod_timer(nographic_timer, interval + qemu_get_clock(rt_clock));
}
+static int shutdown_requested = 0;
+
+void qemu_system_shutdown_request(void)
+{
+ shutdown_requested = 1;
+}
+
+
#ifndef _WIN32
static int io_thread_fd = -1;
@@ -647,7 +655,6 @@ static QemuCond qemu_pause_cond;
static void block_io_signals(void);
static void unblock_io_signals(void);
-static int tcg_has_work(void);
static int qemu_init_main_loop(void)
{
@@ -836,7 +843,7 @@ static void main_loop(void)
qemu_cond_broadcast(&qemu_system_cond);
#endif
- for (;;) {
+ while (!shutdown_requested) {
main_loop_wait(qemu_calculate_timeout());
}
}
@@ -1019,6 +1026,5 @@ int main(int argc, char **argv, char **envp)
main_loop();
quit_timers();
- net_cleanup();
return 0;
}