CueParser: use std::string
This commit is contained in:
		| @@ -31,7 +31,6 @@ | |||||||
|  |  | ||||||
| CueParser::CueParser() | CueParser::CueParser() | ||||||
| 	:state(HEADER), tag(new Tag()), | 	:state(HEADER), tag(new Tag()), | ||||||
| 	 filename(nullptr), |  | ||||||
| 	 current(nullptr), | 	 current(nullptr), | ||||||
| 	 previous(nullptr), | 	 previous(nullptr), | ||||||
| 	 finished(nullptr), | 	 finished(nullptr), | ||||||
| @@ -40,7 +39,6 @@ CueParser::CueParser() | |||||||
| CueParser::~CueParser() | CueParser::~CueParser() | ||||||
| { | { | ||||||
| 	delete tag; | 	delete tag; | ||||||
| 	g_free(filename); |  | ||||||
|  |  | ||||||
| 	if (current != nullptr) | 	if (current != nullptr) | ||||||
| 		current->Free(); | 		current->Free(); | ||||||
| @@ -230,8 +228,7 @@ CueParser::Feed2(char *p) | |||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		state = WAVE; | 		state = WAVE; | ||||||
| 		g_free(filename); | 		filename = new_filename; | ||||||
| 		filename = g_strdup(new_filename); |  | ||||||
| 	} else if (state == IGNORE_FILE) { | 	} else if (state == IGNORE_FILE) { | ||||||
| 		return; | 		return; | ||||||
| 	} else if (strcmp(command, "TRACK") == 0) { | 	} else if (strcmp(command, "TRACK") == 0) { | ||||||
| @@ -251,7 +248,7 @@ CueParser::Feed2(char *p) | |||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		state = TRACK; | 		state = TRACK; | ||||||
| 		current = Song::NewRemote(filename); | 		current = Song::NewRemote(filename.c_str()); | ||||||
| 		assert(current->tag == nullptr); | 		assert(current->tag == nullptr); | ||||||
| 		current->tag = new Tag(*tag); | 		current->tag = new Tag(*tag); | ||||||
| 		current->tag->AddItem(TAG_TRACK, nr); | 		current->tag->AddItem(TAG_TRACK, nr); | ||||||
|   | |||||||
| @@ -23,6 +23,8 @@ | |||||||
| #include "check.h" | #include "check.h" | ||||||
| #include "Compiler.h" | #include "Compiler.h" | ||||||
|  |  | ||||||
|  | #include <string> | ||||||
|  |  | ||||||
| struct Song; | struct Song; | ||||||
| struct Tag; | struct Tag; | ||||||
|  |  | ||||||
| @@ -56,7 +58,7 @@ class CueParser { | |||||||
|  |  | ||||||
| 	Tag *tag; | 	Tag *tag; | ||||||
|  |  | ||||||
| 	char *filename; | 	std::string filename; | ||||||
|  |  | ||||||
| 	/** | 	/** | ||||||
| 	 * The song currently being edited. | 	 * The song currently being edited. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann