]> git.lyx.org Git - lyx.git/commitdiff
fix leak
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 9 Sep 2001 23:00:05 +0000 (23:00 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 9 Sep 2001 23:00:05 +0000 (23:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2714 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/FormMathsBitmap.C
src/frontends/xforms/FormMathsBitmap.h

index db4a450c5c5d722ce6c4dfab11fea9304c23590d..50c5f27f2c001ec0b7be86c7e17ebcb59b969230 100644 (file)
@@ -50,7 +50,7 @@ FormMathsBitmap::FormMathsBitmap(LyXView * lv, Dialogs * d,
 
 FL_FORM * FormMathsBitmap::form() const
 {
-       return form_;
+       return form_.get();
 }
 
 
@@ -60,7 +60,7 @@ void FormMathsBitmap::build()
 
        h_+= 50; // Allow room for a Close button
 
-       form_ = fl_bgn_form(FL_UP_BOX, w_, h_);
+       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_, "");
@@ -70,7 +70,7 @@ void FormMathsBitmap::build()
             it < bitmaps_.end(); ++it) {
                FL_OBJECT * obj = it->get();
 
-               fl_add_object(form_, obj);
+               fl_add_object(form_.get(), obj);
                bc().addReadOnly(obj);
 
                y_ = max(y_, obj->y + obj->h);
index 0370b5afbf5d70a7b93e2d5da586d62c5bf0cbf9..ed39b6c15333fe693fead992d782cccb11fc64ab 100644 (file)
@@ -13,7 +13,6 @@
 #define FORM_MATHSBITMAP_H
 
 #include <vector>
-//#include <boost/smart_ptr.hpp>
 #include "support/smart_ptr.h"
 
 #ifdef __GNUG__
  * This class provides an XForms implementation of a maths bitmap form.
  */
 class FormMathsBitmap : public FormMathsSub {
+       ///
        friend class FormMathsPanel;
 
-  public:
+public:
        ///
        typedef lyx::shared_c_ptr<FL_OBJECT> bm_ptr;
+       ///
+       typedef lyx::shared_c_ptr<FL_FORM> fl_ptr;
+       
        ///
        FormMathsBitmap(LyXView *, Dialogs * d, FormMathsPanel const &,
                        std::vector<string> const &);
@@ -58,7 +61,7 @@ private:
        /// The latex name chosen
        string latex_chosen_;
        /// Real GUI implementation
-       FL_FORM * form_;
+       fl_ptr form_;
        /// The bitmap tables
        std::vector<bm_ptr> bitmaps_;