Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/intern/icons.c7
-rw-r--r--source/blender/src/editscreen.c34
2 files changed, 26 insertions, 15 deletions
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c
index 9617902e057..ee37a4ec9f9 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -50,7 +50,7 @@
/* GLOBALS */
-static GHash* gIcons = 0;
+static GHash* gIcons = NULL;
static int gNextIconId = 1;
@@ -106,8 +106,9 @@ void BKE_icons_init(int first_dyn_id)
void BKE_icons_free()
{
- BLI_ghash_free(gIcons, 0, icon_free);
- gIcons = 0;
+ if(gIcons)
+ BLI_ghash_free(gIcons, 0, icon_free);
+ gIcons = NULL;
}
diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c
index 6d3d4577ebc..ccb899ded9a 100644
--- a/source/blender/src/editscreen.c
+++ b/source/blender/src/editscreen.c
@@ -154,10 +154,12 @@ static void screen_set_cursor(bScreen *sc)
void waitcursor(int val)
{
- if(val) {
- set_cursor(CURSOR_WAIT);
- } else {
- screen_set_cursor(G.curscreen);
+ if(G.curscreen) {
+ if(val) {
+ set_cursor(CURSOR_WAIT);
+ } else {
+ screen_set_cursor(G.curscreen);
+ }
}
}
@@ -1481,7 +1483,8 @@ void screenmain(void)
#if 0
//#ifdef _WIN32 // FULLSCREEN
-void mainwindow_toggle_fullscreen(int fullscreen){
+void mainwindow_toggle_fullscreen(int fullscreen)
+{
if (fullscreen) U.uiflag |= USER_FLIPFULLSCREEN;
else U.uiflag &= ~USER_FLIPFULLSCREEN;
@@ -1489,20 +1492,27 @@ void mainwindow_toggle_fullscreen(int fullscreen){
}
#endif
-void mainwindow_raise(void) {
- window_raise(mainwin);
+void mainwindow_raise(void)
+{
+ if(mainwin)
+ window_raise(mainwin);
}
-void mainwindow_make_active(void) {
- window_make_active(mainwin);
+void mainwindow_make_active(void)
+{
+ if(mainwin)
+ window_make_active(mainwin);
}
-void mainwindow_close(void) {
- window_destroy(mainwin);
+void mainwindow_close(void)
+{
+ if(mainwin)
+ window_destroy(mainwin);
mainwin= NULL;
}
-void mainwindow_set_filename_to_title(char *filename) {
+void mainwindow_set_filename_to_title(char *filename)
+{
char str[FILE_MAXDIR + FILE_MAXFILE];
char dir[FILE_MAXDIR];
char file[FILE_MAXFILE];