Ok, so I'm a donkey! Easy, easy fix to that ol' memory leak. (And it was

suggested days ago by Lars too :-()


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2753 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2001-09-13 11:44:07 +00:00
parent 1bfe247634
commit 82ed71bfcb
3 changed files with 23 additions and 9 deletions

View File

@ -1,3 +1,8 @@
2001-09-13 Angus Leeming <a.leeming@ic.ac.uk>
* FormMathsBitmap.[Ch]: add d-tor to finally fix a memory leak.
Hoorah! Happy Birthday to me!
2001-09-07 Dekel Tsur <dekelts@tau.ac.il>
* forms/form_ref.fd: Add buffer button.

View File

@ -48,6 +48,16 @@ FormMathsBitmap::FormMathsBitmap(LyXView * lv, Dialogs * d,
}
FormMathsBitmap::~FormMathsBitmap()
{
if (!form())
return;
if (form()->visible) fl_hide_form(form());
fl_free_form(form());
}
FL_FORM * FormMathsBitmap::form() const
{
return form_.get();
@ -63,8 +73,7 @@ void FormMathsBitmap::build()
form_.reset(fl_bgn_form(FL_UP_BOX, w_, h_));
form_->u_vdata = this;
FL_OBJECT * obj = fl_add_box(FL_UP_BOX, 0, 0, w_, h_, "");
//fl_add_object(form_.get(), obj);
fl_add_box(FL_UP_BOX, 0, 0, w_, h_, "");
y_ = 0;
for (vector<bm_ptr>::const_iterator it = bitmaps_.begin();
@ -78,16 +87,14 @@ void FormMathsBitmap::build()
}
char const * const label = N_("Close|^[");
x_ = (form_->w - 90) / 2;
y_ += 10;
FL_OBJECT * button_cancel = obj =
FL_OBJECT * button_cancel =
fl_add_button(FL_NORMAL_BUTTON, x_, y_, 90, 30, idex(_(label)));
//fl_add_object(form_.get(), obj);
fl_set_button_shortcut(obj, scex(_(label)), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseDeprecatedCancelCB, 0);
fl_set_button_shortcut(button_cancel, scex(_(label)), 1);
fl_set_object_lsize(button_cancel, FL_NORMAL_SIZE);
fl_set_object_callback(button_cancel, C_FormBaseDeprecatedCancelCB, 0);
fl_end_form();

View File

@ -39,6 +39,8 @@ public:
FormMathsBitmap(LyXView *, Dialogs * d, FormMathsPanel const &,
std::vector<string> const &);
///
~FormMathsBitmap();
///
void addBitmap(int, int, int, int, int, unsigned char const *,
bool = true);