devilhorns pushed a commit to branch master.

commit 7fa2c11e728be506c400f4b732e3dd027ad54eeb
Author: Chris Michael <[email protected]>
Date:   Wed Jul 24 07:15:44 2013 +0100

    Add some checking/trapping for valid wayland display.
    Remove dead commented lines
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_wayland/ecore_wl.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c
index ee2f16e..3ee7aa6 100644
--- a/src/lib/ecore_wayland/ecore_wl.c
+++ b/src/lib/ecore_wayland/ecore_wl.c
@@ -194,16 +194,14 @@ ecore_wl_shutdown(void)
 EAPI void
 ecore_wl_flush(void)
 {
-//   LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
+   if ((!_ecore_wl_disp) || (!_ecore_wl_disp->wl.display)) return;
    wl_display_flush(_ecore_wl_disp->wl.display);
 }
 
 EAPI void
 ecore_wl_sync(void)
 {
-//   LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
+   if ((!_ecore_wl_disp) || (!_ecore_wl_disp->wl.display)) return;
    _ecore_wl_sync_wait(_ecore_wl_disp);
    while (_ecore_wl_disp->sync_ref_count > 0)
      wl_display_dispatch(_ecore_wl_disp->wl.display);
@@ -212,24 +210,31 @@ ecore_wl_sync(void)
 EAPI struct wl_shm *
 ecore_wl_shm_get(void)
 {
+   if (!_ecore_wl_disp) return NULL;
    return _ecore_wl_disp->wl.shm;
 }
 
 EAPI struct wl_display *
 ecore_wl_display_get(void)
 {
+   if ((!_ecore_wl_disp) || (!_ecore_wl_disp->wl.display)) 
+     return NULL;
    return _ecore_wl_disp->wl.display;
 }
 
 EAPI struct wl_list *
 ecore_wl_globals_get(void)
 {
+   if ((!_ecore_wl_disp) || (!_ecore_wl_disp->wl.display)) 
+     return NULL;
    return &(_ecore_wl_disp->globals);
 }
 
 EAPI struct wl_registry *
 ecore_wl_registry_get(void)
 {
+   if ((!_ecore_wl_disp) || (!_ecore_wl_disp->wl.display)) 
+     return NULL;
    return _ecore_wl_disp->wl.registry;
 }
 
@@ -241,6 +246,8 @@ ecore_wl_screen_size_get(int *w, int *h)
    if (w) *w = 0;
    if (h) *h = 0;
 
+   if ((!_ecore_wl_disp) || (!_ecore_wl_disp->wl.display)) return;
+
    if (!_ecore_wl_disp->output)
      ecore_wl_sync();
 
@@ -278,6 +285,7 @@ ecore_wl_dpi_get(void)
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
+   if (!_ecore_wl_disp) return 0;
    if (!_ecore_wl_disp->output) return 75;
 
    mw = _ecore_wl_disp->output->mw;
@@ -292,6 +300,7 @@ ecore_wl_dpi_get(void)
 EAPI void
 ecore_wl_display_iterate(void)
 {
+   if ((!_ecore_wl_disp) || (!_ecore_wl_disp->wl.display)) return;
    if (!_ecore_wl_server_mode)
      wl_display_dispatch(_ecore_wl_disp->wl.display);
 }

-- 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

Reply via email to