Previous 15994 Revisions Next

r7815 Thursday 15th April, 2010 at 15:39:23 UTC by Firewave
[WINUI] Fixed memory leaks
[src/osd/winui]datafile.c winui.c

src/osd/winui/datafile.c
r7814r7815
6060static const char *DATAFILE_TAG_BIO = "$bio";
6161static const char *DATAFILE_TAG_MAME = "$mame";
6262
63const char *history_filename = NULL;
64const char *mameinfo_filename = NULL;
63char *g_history_filename = NULL;
64char *g_mameinfo_filename = NULL;
6565
6666
6767/****************************************************************************
r7814r7815
606606        *buffer = 0;
607607
608608
609        if (!history_filename || !*history_filename)
610                history_filename = "history.dat";
609        if (!g_history_filename || !*g_history_filename)
610                g_history_filename = mame_strdup("history.dat");
611611
612612        /* try to open history datafile */
613        if (ParseOpen (history_filename))
613        if (ParseOpen (g_history_filename))
614614        {
615615                /* create index if necessary */
616616                if (hist_idx)
r7814r7815
638638                ParseClose ();
639639        }
640640
641        if (!mameinfo_filename || !*mameinfo_filename)
642                mameinfo_filename = "mameinfo.dat";
641        if (!g_mameinfo_filename || !*g_mameinfo_filename)
642                g_mameinfo_filename = mame_strdup("mameinfo.dat");
643643
644644        /* try to open mameinfo datafile */
645        if (ParseOpen (mameinfo_filename))
645        if (ParseOpen (g_mameinfo_filename))
646646        {
647647                /* create index if necessary */
648648                if (mame_idx)
src/osd/winui/winui.c
r7814r7815
238238extern const ICONDATA g_iconData[];
239239extern const TCHAR g_szPlayGameString[];
240240extern const char g_szGameCountString[];
241extern char *g_history_filename;
242extern char *g_mameinfo_filename;
241243
242244typedef struct _play_options play_options;
243245struct _play_options
r7814r7815
17221724   int i, nSplitterCount;
17231725   extern const FOLDERDATA g_folderData[];
17241726   extern const FILTER_ITEM g_filterList[];
1725   extern const char *history_filename;
1726   extern const char *mameinfo_filename;
17271727   LONG common_control_version = GetCommonControlVersion();
17281728   int validity_failed = 0;
17291729   TCHAR* t_inpdir = NULL;
r7814r7815
18931893   hTreeView = GetDlgItem(hMain, IDC_TREE);
18941894   hwndList  = GetDlgItem(hMain, IDC_LIST);
18951895
1896   history_filename = mame_strdup(GetHistoryFileName());
1897   mameinfo_filename = mame_strdup(GetMAMEInfoFileName());
1896   g_history_filename = mame_strdup(GetHistoryFileName());
1897   g_mameinfo_filename = mame_strdup(GetMAMEInfoFileName());
18981898
18991899   if (!InitSplitters())
19001900      return FALSE;
r7814r7815
21592159
21602160   HelpExit();
21612161
2162   osd_free(g_mameinfo_filename);
2163   osd_free(g_history_filename);
2164
21622165   pool_free_lib(mameui_pool);
21632166   mameui_pool = NULL;
21642167}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team