summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-05-26 00:46:10 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-05-26 00:46:10 +0000
commitda3b9764b7d50959ad7df1690cd5c0c4cf1c8c54 (patch)
tree65a09c4a0a92f14399e23a582eb1d243f67fc65a
parenta416f770b72a216406685b8011b4e557992a0916 (diff)
downloadnavit-da3b9764b7d50959ad7df1690cd5c0c4cf1c8c54.tar.gz
Add:Core:Check for existence of event system before using it
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3297 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r--navit/event.c6
-rw-r--r--navit/event.h1
-rw-r--r--navit/graphics.c3
-rw-r--r--navit/messages.c2
4 files changed, 11 insertions, 1 deletions
diff --git a/navit/event.c b/navit/event.c
index daa5de8b7..611579f02 100644
--- a/navit/event.c
+++ b/navit/event.c
@@ -93,6 +93,12 @@ event_call_callback(struct callback_list *cb)
event_methods.call_callback(cb);
}
+char *
+event_system(void)
+{
+ return e_system;
+}
+
int
event_request_system(const char *system, const char *requestor)
{
diff --git a/navit/event.h b/navit/event.h
index 3b1664600..0b5aeb53e 100644
--- a/navit/event.h
+++ b/navit/event.h
@@ -64,6 +64,7 @@ void event_remove_timeout(struct event_timeout *ev);
struct event_idle *event_add_idle(int priority, struct callback *cb);
void event_remove_idle(struct event_idle *ev);
void event_call_callback(struct callback_list *cb);
+char *event_system(void);
int event_request_system(const char *system, const char *requestor);
/* end of prototypes */
#ifdef __cplusplus
diff --git a/navit/graphics.c b/navit/graphics.c
index b2bf28022..6d57d1496 100644
--- a/navit/graphics.c
+++ b/navit/graphics.c
@@ -1966,7 +1966,8 @@ do_draw(struct displaylist *displaylist, int cancel, int flags)
displaylist->m=NULL;
}
profile(1,"process_selection\n");
- event_remove_idle(displaylist->idle_ev);
+ if (displaylist->idle_ev)
+ event_remove_idle(displaylist->idle_ev);
displaylist->idle_ev=NULL;
callback_destroy(displaylist->idle_cb);
displaylist->idle_cb=NULL;
diff --git a/navit/messages.c b/navit/messages.c
index 141070979..b3d9ddcce 100644
--- a/navit/messages.c
+++ b/navit/messages.c
@@ -144,6 +144,8 @@ struct messagelist
void
messagelist_init(struct messagelist *this_)
{
+ if (!event_system())
+ return;
this_->msg_cleanup_cb = callback_new_1(callback_cast(message_cleanup), this_);
this_->msg_cleanup_to = event_add_timeout(1000, 1, this_->msg_cleanup_cb);
}