Segmentation fault
This commit is contained in:
@@ -79,6 +79,7 @@ textFile_t LoadTextFile(string file, bool verbose)
|
||||
// Constructor
|
||||
Text::Text(string textFile, string bitmapFile, SDL_Renderer *renderer)
|
||||
{
|
||||
//std::cout << "Construido Text" << std::endl;
|
||||
// Carga los offsets desde el fichero
|
||||
textFile_t tf = LoadTextFile(textFile);
|
||||
|
||||
@@ -104,6 +105,7 @@ Text::Text(string textFile, string bitmapFile, SDL_Renderer *renderer)
|
||||
// Constructor
|
||||
Text::Text(string textFile, Texture *texture, SDL_Renderer *renderer)
|
||||
{
|
||||
//std::cout << "Construido Text" << std::endl;
|
||||
// Carga los offsets desde el fichero
|
||||
textFile_t tf = LoadTextFile(textFile);
|
||||
|
||||
@@ -128,6 +130,7 @@ Text::Text(string textFile, Texture *texture, SDL_Renderer *renderer)
|
||||
// Constructor
|
||||
Text::Text(textFile_t *textFile, Texture *texture, SDL_Renderer *renderer)
|
||||
{
|
||||
//std::cout << "Construido Text" << std::endl;
|
||||
// Inicializa variables desde la estructura
|
||||
boxHeight = textFile->boxHeight;
|
||||
boxWidth = textFile->boxWidth;
|
||||
@@ -149,8 +152,13 @@ Text::Text(textFile_t *textFile, Texture *texture, SDL_Renderer *renderer)
|
||||
// Destructor
|
||||
Text::~Text()
|
||||
{
|
||||
delete sprite;
|
||||
if (texture)
|
||||
//std::cout << "Destruido Text" << std::endl;
|
||||
if (sprite != nullptr)
|
||||
{
|
||||
delete sprite;
|
||||
}
|
||||
|
||||
if (texture != nullptr)
|
||||
{
|
||||
delete texture;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user