aboutsummaryrefslogtreecommitdiffstats
path: root/src/gfx.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-02-03 18:02:05 +1000
committerinmarket <andrewh@inmarket.com.au>2014-02-03 18:02:05 +1000
commit479660a23dee99641aa5d677f86fb81962bfbbad (patch)
tree3a0997a7cc090510a2298ae0d615662ea9c373b9 /src/gfx.c
parent9774c86d0e8c171f414eecdf6b1b3f9598986b69 (diff)
parentd869d9b3b80cb9ab2314840b2fa274e89e5342db (diff)
downloaduGFX-479660a23dee99641aa5d677f86fb81962bfbbad.tar.gz
uGFX-479660a23dee99641aa5d677f86fb81962bfbbad.tar.bz2
uGFX-479660a23dee99641aa5d677f86fb81962bfbbad.zip
Merge branch 'master' into gwin
Diffstat (limited to 'src/gfx.c')
-rw-r--r--src/gfx.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gfx.c b/src/gfx.c
index 46003f09..dfc9cb75 100644
--- a/src/gfx.c
+++ b/src/gfx.c
@@ -15,6 +15,8 @@
#include "gfx.h"
+static bool_t initDone = FALSE;
+
/* These init functions are defined by each module but not published */
extern void _gosInit(void);
extern void _gosDeinit(void);
@@ -57,6 +59,11 @@ extern void _gosDeinit(void);
void gfxInit(void)
{
+ /* Ensure we only initialise once */
+ if (initDone)
+ return;
+ initDone = TRUE;
+
// These must be initialised in the order of their dependancies
_gosInit();
@@ -91,8 +98,11 @@ void gfxInit(void)
void gfxDeinit(void)
{
- // We deinitialise the opposit way as we initialised
+ if (!initDone)
+ return;
+ initDone = FALSE;
+ // We deinitialise the opposite way as we initialised
#if GFX_USE_GAUDOUT
_gaudoutDeinit();
#endif