Skip to content

Commit

Permalink
NWN: Fix an uninitialized pointer
Browse files Browse the repository at this point in the history
Even if it was initialized afterward (in redoLayout()), it causes
a severe crash on an OSX system by losing the tooltip adress.

By the way, it seems that in the structure Line in tooltip.h the UString line is
almost unused and redondant with the Aurora::Graphics::Text which already contains
the string.
  • Loading branch information
Supermanu authored and DrMcCoy committed Dec 8, 2013
1 parent f193f1c commit 2c01212
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/engines/nwn/gui/widgets/tooltip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ void Tooltip::addLine(const Common::UString &text, float r, float g, float b, fl
_lines.back().b = b;
_lines.back().a = a;
_lines.back().line = *l;
_lines.back().text = new Graphics::Aurora::Text(FontMan.get(getFontName()), *l);
_lines.back().text->setTag("Tooltip#Text");
}

redoLayout();
Expand Down

0 comments on commit 2c01212

Please sign in to comment.