diff --git a/acinclude.m4 b/acinclude.m4 index 4f029d06a..0f67ee152 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -339,13 +339,6 @@ AC_ARG_WITH(boxmodel, AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE]) fi ;; - raspi) - if test "$BOXTYPE" = "generic"; then - BOXMODEL="$withval" - else - AC_MSG_ERROR([unknown model $withval for boxtype $BOXTYPE]) - fi - ;; *) AC_MSG_ERROR([unsupported value $withval for --with-boxmodel]) ;; diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index ff7ee60f9..0f4ef2fd5 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -820,6 +820,7 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in return false; int yy = y; + bool freeicondata = false; //printf("CFrameBuffer::paintIcon: load %s\n", filename.c_str());fflush(stdout); /* we cache and check original name */ @@ -904,6 +905,8 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in cache_size += dsize; icon_cache.insert(std::pair (filename, tmpIcon)); //printf("Cached %s, cache size %d\n", newname.c_str(), cache_size); + }else{ + freeicondata = true; } } else { data = it->second.data; @@ -912,9 +915,13 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in //printf("paintIcon: already cached %s %d x %d\n", newname.c_str(), width, height); } _display: - if(!paint) + if(!paint){ + if(freeicondata){ + free(data); + data = NULL; + } return true; - + } if (h != 0) yy += (h - height) / 2; @@ -1383,7 +1390,7 @@ void CFrameBuffer::useBackground(bool ub) useBackgroundPaint = ub; if(!useBackgroundPaint) { delete[] background; - background=0; + background=NULL; } } @@ -1406,10 +1413,11 @@ void CFrameBuffer::saveBackgroundImage(void) void CFrameBuffer::restoreBackgroundImage(void) { - fb_pixel_t * tmp = background; + fb_pixel_t * tmp = NULL; if (backupBackground != NULL) { + tmp = background; background = backupBackground; backupBackground = NULL; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 0212ed201..b37c625fe 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -229,9 +229,6 @@ CNeutrinoFonts * neutrinoFonts = NULL; bool parentallocked = false; static char **global_argv; -/* hack until we have real platform abstraction... */ -static bool can_deepstandby = false; - extern const char * locale_real_names[]; /* #include */ /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -2291,7 +2288,6 @@ TIMER_START(); #endif g_info.hw_caps = get_hwcaps(); - can_deepstandby = g_info.hw_caps->can_shutdown; g_Locale = new CLocaleManager; @@ -3911,6 +3907,7 @@ extern bool timer_is_rec;//timermanager.cpp void CNeutrinoApp::ExitRun(int can_shutdown) { + /* can_shutdown is actually our exit code */ printf("[neutrino] %s can_shutdown: %d\n", __func__, can_shutdown); bool do_shutdown = true; @@ -4048,70 +4045,76 @@ void CNeutrinoApp::ExitRun(int can_shutdown) } else { -#endif - int leds = 0; - int bright = 0; -#if HAVE_COOL_HARDWARE - if (can_shutdown) { - leds = 0x40; - switch (g_settings.led_deep_mode){ - case 0: - leds = 0x0;//off leds - break; - case 1: - leds = 0x60;//on led1 & 2 - break; - case 2: - leds = 0x20;//led1 on , 2 off - break; - case 3: - leds = 0x40;//led2 off, 2 on - break; - default: - break; - } - if (leds && g_settings.led_blink && timer_minutes) - leds |= 0x80; - } - if (cs_get_revision() != 10) - bright = g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS]; -#endif - if (timer_minutes || leds) - { - FILE *f = fopen("/tmp/.timer", "w"); - if (f) - { - fprintf(stderr, "timer_wakeup: %ld\n", timer_minutes * 60); - fprintf(f, "%ld\n", timer_minutes * 60); - fprintf(f, "%d\n", leds); - fprintf(f, "%d\n", bright); - fclose(f); - } - else - perror("fopen /tmp/.timer"); - } - - delete g_RCInput; - g_RCInput = NULL; - //fan speed - if (g_info.hw_caps->has_fan) { - CFanControlNotifier::setSpeed(0); - } - //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT)); - delete CVFD::getInstance(); - delete SHTDCNT::getInstance(); - stop_video(); - - printf("[neutrino] This is the end. exiting with code %d\n", can_shutdown); - Cleanup(); -#ifdef __sh__ - /* the sh4 gcc seems to dislike someting about openthreads... */ - _exit(can_shutdown); -#else - exit(can_shutdown); -#endif -#if 0 + delete g_RCInput; + my_system("/etc/init.d/rcK"); + //fan speed + if (g_info.hw_caps->has_fan) + CFanControlNotifier::setSpeed(0); + stop_video(); + Cleanup(); + //_exit(0); + exit(0); } +#endif + int leds = 0; + int bright = 0; +#if HAVE_COOL_HARDWARE + if (can_shutdown) { + leds = 0x40; + switch (g_settings.led_deep_mode){ + case 0: + leds = 0x0;//off leds + break; + case 1: + leds = 0x60;//on led1 & 2 + break; + case 2: + leds = 0x20;//led1 on , 2 off + break; + case 3: + leds = 0x40;//led2 off, 2 on + break; + default: + break; + } + if (leds && g_settings.led_blink && timer_minutes) + leds |= 0x80; + } + if (cs_get_revision() != 10) + bright = g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS]; +#endif + if (timer_minutes || leds) + { + FILE *f = fopen("/tmp/.timer", "w"); + if (f) + { + fprintf(stderr, "timer_wakeup: %ld\n", timer_minutes * 60); + fprintf(f, "%ld\n", timer_minutes * 60); + fprintf(f, "%d\n", leds); + fprintf(f, "%d\n", bright); + fclose(f); + } + else + perror("fopen /tmp/.timer"); + } + + delete g_RCInput; + g_RCInput = NULL; + //fan speed + if (g_info.hw_caps->has_fan) + CFanControlNotifier::setSpeed(0); + //CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT)); + delete CVFD::getInstance(); + delete SHTDCNT::getInstance(); + stop_video(); + + printf("[neutrino] This is the end. exiting with code %d\n", can_shutdown); + Cleanup(); +#ifdef __sh__ + /* the sh4 gcc seems to dislike someting about openthreads... */ + _exit(can_shutdown); +#else + exit(can_shutdown); #endif }