moviebrowser: fix possible memleak in initSeriesMenu()

thx satbaby for hints


Origin commit data
------------------
Commit: 90406340a4
Author: Thilo Graf <dbt@novatux.de>
Date: 2019-06-25 (Tue, 25 Jun 2019)
This commit is contained in:
2019-06-25 20:44:57 +02:00
committed by vanhofen
parent 87cef887c1
commit 9664ce0a86
2 changed files with 6 additions and 6 deletions

View File

@@ -58,7 +58,6 @@
#include <gui/components/cc.h>
#include <gui/widget/msgbox.h>
#include <gui/widget/stringinput.h>
#include <gui/widget/keyboard_input.h>
#include <dirent.h>
#include <sys/stat.h>
#include <gui/nfs.h>
@@ -3433,12 +3432,11 @@ void CMovieBrowser::initBookMarkMenu(CMenuWidget *BookmarkMenu, MI_MOVIE_INFO* m
}
#define MAX_STRING 30
void CMovieBrowser::initSeriesMenu(CMenuWidget *SeriesMenu, MI_MOVIE_INFO* movie_info)
void CMovieBrowser::initSeriesMenu(CMenuWidget *SeriesMenu, MI_MOVIE_INFO* movie_info, CKeyboardInput *SerieUserInput)
{
SeriesMenu->addIntroItems(LOCALE_MOVIEBROWSER_SERIE_HEAD);
CKeyboardInput *serieUserInput = new CKeyboardInput(LOCALE_MOVIEBROWSER_EDIT_SERIE, &movie_info->serieName, MAX_STRING); //TODO: hints
SeriesMenu->addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_SERIE_NAME, true, movie_info->serieName, serieUserInput));
SeriesMenu->addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_SERIE_NAME, true, movie_info->serieName, SerieUserInput));
SeriesMenu->addItem(GenericMenuSeparatorLine);
for (unsigned int li = 0; li < m_vHandleSerienames.size(); li++)
@@ -3484,7 +3482,8 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info)
// init series menu
CMenuWidget serieMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER);
initSeriesMenu(&serieMenu, movie_info);
CKeyboardInput serieUserInput(LOCALE_MOVIEBROWSER_EDIT_SERIE, &movie_info->serieName, MAX_STRING); //TODO: hints
initSeriesMenu(&serieMenu, movie_info, &serieUserInput);
// init update movie info menu
CMenuWidget movieInfoMenuUpdate(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER);

View File

@@ -60,6 +60,7 @@
#include <system/setting_helpers.h>
#include <gui/widget/progresswindow.h>
#include <gui/widget/stringinput_ext.h>
#include <gui/widget/keyboard_input.h>
#include <gui/imdb.h>
#define MAX_NUMBER_OF_BOOKMARK_ITEMS MI_MOVIE_BOOK_USER_MAX // we just use the same size as used in Movie info (MAX_NUMBER_OF_BOOKMARK_ITEMS is used for the number of menu items)
@@ -349,7 +350,7 @@ class CMovieBrowser : public CMenuTarget, public CProgressSignals
///// Menu ////////////////////////////////////
bool showMenu(bool calledExternally = false);
void initBookMarkMenu(CMenuWidget *BookmarkMenu, MI_MOVIE_INFO* movie_info, CIntInput* BookStartIntInput, CIntInput* BookLastIntInput, CIntInput* BookEndIntInput);
void initSeriesMenu(CMenuWidget *SeriesMenu, MI_MOVIE_INFO* movie_info);
void initSeriesMenu(CMenuWidget *SeriesMenu, MI_MOVIE_INFO* movie_info, CKeyboardInput *SerieUserInput);
void initUpdateMovieInfoMenu(CMenuWidget *MovieInfoMenuUpdate);
void initParentalMenu(CMenuWidget *ParentalMenu);
void initOptionsDirMenu(CMenuWidget *OptionsMenuDir, std::vector<COnOffNotifier*>& v_notifiers);