Background rendering didn't work anymore!

- STUPID mistake from me in setting the waitcursor...
- icons for UI got freed, without checking if it existed (crash in end)
- call to close mainwindow didn't check if window existed

note:
I usually test the "blender -b" case, which should start blender,
initialize all, free all, and print "blender quit" to signal all is fine.
This commit is contained in:
Ton Roosendaal
2006-06-15 11:15:25 +00:00
parent ecb204fa7c
commit 680eed3758
2 changed files with 26 additions and 15 deletions

View File

@@ -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;
}

View File

@@ -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];