diff options
| author | Matthias Melcher <github@matthiasm.com> | 2022-11-23 15:17:54 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2022-11-23 15:18:01 +0100 |
| commit | 817a97bb65883b0ffdbcf9a8eb5b4431cd8a4331 (patch) | |
| tree | ad3b10bb7a0e202a53e25c3b213cc1c305b6792b /fluid/CodeEditor.cxx | |
| parent | 410e57d2db426cb4ab3c8f4b9472ee33e17a5f99 (diff) | |
Fluid: Fix variable naming and a memory leak
Diffstat (limited to 'fluid/CodeEditor.cxx')
| -rw-r--r-- | fluid/CodeEditor.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/fluid/CodeEditor.cxx b/fluid/CodeEditor.cxx index ec8afd789..eea99d24d 100644 --- a/fluid/CodeEditor.cxx +++ b/fluid/CodeEditor.cxx @@ -295,16 +295,24 @@ void CodeViewer::draw() Fl::set_color(FL_SELECTION_COLOR, c); } -// ---- DesignViewer implementation +// ---- TextViewer implementation /** - Create a DesignViewer widget. + Create a TextViewer widget. \param[in] X, Y, W, H position and size of the widget \param[in] L optional label */ -DesignViewer::DesignViewer(int X, int Y, int W, int H, const char *L) +TextViewer::TextViewer(int X, int Y, int W, int H, const char *L) : Fl_Text_Display(X, Y, W, H, L) { buffer(new Fl_Text_Buffer); } +/** + Avoid memory leaks. + */ +TextViewer::~TextViewer() { + Fl_Text_Buffer *buf = mBuffer; + buffer(0); + delete buf; +} |
