Skip to content

Commit

Permalink
Merge pull request #224 from walkero-gr/memory-fixes
Browse files Browse the repository at this point in the history
Fixed memory leaks and lists overflows
  • Loading branch information
walkero-gr authored Sep 1, 2023
2 parents ef4ada5 + b6ee5c9 commit ab3b357
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
## iGame VERSION_TAG - [RELEASE_DATE]
### Fixed
- Fixed memory leaks
- Fixed the lists getting wrong values when overflow

## iGame 2.4.2 - [2023-08-27]
### Changed
- Simplified the version string and added the release date in the screen title

Expand Down
9 changes: 9 additions & 0 deletions Makefile.docker
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,19 @@ ifneq (,$(filter MOS,$(CPU)))
CFLAGS += +morphos -DCPU_VERS=MorphOS -D__morphos__
endif

ifeq ($(DEBUG), 1)
CFLAGS += -g -hunkdebug
endif

##########################################################################
# Linker settings
##########################################################################
LIBFLAGS = -lamiga

ifeq ($(DEBUG), 1)
LIBFLAGS += -g -Bamigahunk
endif

ifneq (,$(filter 000 030 040 060,$(CPU)))
LIBFLAGS += +aos68k -o
endif
Expand All @@ -93,6 +101,7 @@ ifneq (,$(filter MOS,$(CPU)))
LIBFLAGS += +morphos -o
endif


##########################################################################
# Object files which are part of iGame
##########################################################################
Expand Down
1 change: 1 addition & 0 deletions src/fsfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ void getIGameDataInfo(char *igameDataPath, slavesList *node)
{
strncpy(node->path, tmpTbl[1], MAX_PATH_SIZE);
}
free(tmpTbl);
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ static BOOL examineFolder(char *path)
{
getIGameDataInfo(igameDataPath, node);
}
free(igameDataPath);
}

// Generate title and add in the list
Expand Down Expand Up @@ -930,6 +931,7 @@ static BOOL examineFolder(char *path)
{
getIGameDataInfo(igameDataPath, node);
}
free(igameDataPath);

if (!isStringEmpty(node->genre))
strncpy(existingNode->genre, node->genre, MAX_GENRE_NAME_SIZE);
Expand Down
2 changes: 1 addition & 1 deletion src/iGameGUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct ObjApp
CONST_STRPTR STR_TX_PropertiesSlavePath;
CONST_STRPTR STR_TX_PropertiesTooltypes;
CONST_STRPTR STR_TX_About;
CONST_STRPTR CY_PropertiesGenreContent[128];
CONST_STRPTR CY_PropertiesGenreContent[256];
CONST_STRPTR CY_ScreenshotSizeContent[4];
CONST_STRPTR RA_TitlesFromContent[3];
CONST_STRPTR CY_FilterListContent[6];
Expand Down
14 changes: 7 additions & 7 deletions src/iGameMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static int initLibraries(void)
{
#ifdef __amigaos4__
IMUIMaster = (struct MUIMasterIFace *)GetInterface(MUIMasterBase, "main", 1, NULL);
if(!IMUIMaster) return clean_exit("Can't open muimaster Interface");
if(!IMUIMaster) return clean_exit("Can't open muimaster Interface\n");
#endif
}
else return clean_exit("Can't open muimaster.library v19\n");
Expand All @@ -284,7 +284,7 @@ static int initLibraries(void)
{
#ifdef __amigaos4__
IIcon = (struct IconIFace *)GetInterface( IconBase, "main", 1, NULL );
if(!IIcon) return clean_exit("Can't open icon.library Interface");
if(!IIcon) return clean_exit("Can't open icon.library Interface\n");
#endif
}
else return clean_exit("Can't open icon.library v37 or greater\n");
Expand All @@ -297,7 +297,7 @@ static int initLibraries(void)
{
#ifdef __amigaos4__
IIntuition = (struct IntuitionIFace *)GetInterface( IntuitionBase, "main", 1, NULL );
if(!IIntuition) return clean_exit("Can't open intuition.library Interface");
if(!IIntuition) return clean_exit("Can't open intuition.library Interface\n");
#endif
}
else return clean_exit("Can't open intuition.library v37 or greater\n");
Expand All @@ -306,7 +306,7 @@ static int initLibraries(void)
{
#ifdef __amigaos4__
IGraphics = (struct GraphicsIFace *)GetInterface( GfxBase, "main", 1, NULL );
if(!IGraphics) return clean_exit("Can't open graphics.library Interface");
if(!IGraphics) return clean_exit("Can't open graphics.library Interface\n");
#endif
}
else return clean_exit("Can't open graphics.library v37 or greater\n");
Expand All @@ -315,7 +315,7 @@ static int initLibraries(void)
{
#ifdef __amigaos4__
IWorkbench = (struct WorkbenchIFace *)GetInterface( WorkbenchBase, "main", 1, NULL );
if(!IWorkbench) return clean_exit("Can't open workbench.library Interface");
if(!IWorkbench) return clean_exit("Can't open workbench.library Interface\n");
#endif
}
else return clean_exit("Can't open workbench.library v37 or greater\n");
Expand All @@ -324,7 +324,7 @@ static int initLibraries(void)
{
#ifdef __amigaos4__
IDataTypes = (struct DataTypesIFace *)GetInterface( DataTypesBase, "main", 1, NULL );
if(!IDataTypes) return clean_exit("Can't open datatypes.library Interface");
if(!IDataTypes) return clean_exit("Can't open datatypes.library Interface\n");
#endif
}
else return clean_exit("Can't open datatypes.library v37 or greater\n");
Expand All @@ -333,7 +333,7 @@ static int initLibraries(void)
{
#ifdef __amigaos4__
IUtility = (struct UtilityIFace *)GetInterface( UtilityBase, "main", 1, NULL );
if(!IUtility) return clean_exit("Can't open Utility.library Interface");
if(!IUtility) return clean_exit("Can't open Utility.library Interface\n");
#endif
}
else return clean_exit("Can't open utility.library v37 or greater\n");
Expand Down

0 comments on commit ab3b357

Please sign in to comment.