Changeset - r12092:313f75995278
[Not reviewed]
master
0 1 0
smatz - 15 years ago 2009-06-03 00:05:51
smatz@openttd.org
(svn r16507) -Fix (r16503): segfault when deleting non-last graphics set
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/gfxinit.cpp
Show inline comments
 
@@ -459,8 +459,8 @@ bool OBGFileScanner::AddFile(const char 
 
	}
 

	
 
	if (FillGraphicsSetDetails(graphics, ini, path)) {
 
		const GraphicsSet *duplicate = NULL;
 
		for (const GraphicsSet *c = _available_graphics_sets; c != NULL; c = c->next) {
 
		GraphicsSet *duplicate = NULL;
 
		for (GraphicsSet *c = _available_graphics_sets; c != NULL; c = c->next) {
 
			if (strcmp(c->name, graphics->name) == 0 || c->shortname == graphics->shortname) {
 
				duplicate = c;
 
				break;
 
@@ -476,6 +476,8 @@ bool OBGFileScanner::AddFile(const char 
 

	
 
				*prev = graphics;
 
				graphics->next = duplicate->next;
 
				/* don't allow recursive delete of all remaining items */
 
				duplicate->next = NULL;
 

	
 
				DEBUG(grf, 1, "Removing %s (%i) as base graphics set (duplicate)", duplicate->name, duplicate->version);
 
				delete duplicate;
0 comments (0 inline, 0 general)