On Tuesday 11 September 2001 13:35, Lars Gullik Bjønnes wrote:
> Angus Leeming <[EMAIL PROTECTED]> writes:
>
> | Index: src/frontends/xforms/FormMathsBitmap.C
> | ===================================================================
> | RCS file:
> | /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormMathsBitmap.C,v
> | retrieving revision 1.12
> | diff -u -p -r1.12 FormMathsBitmap.C
> | --- src/frontends/xforms/FormMathsBitmap.C 2001/09/10 14:00:33 1.12
> | +++ src/frontends/xforms/FormMathsBitmap.C 2001/09/11 09:30:02
> | @@ -48,6 +48,24 @@ FormMathsBitmap::FormMathsBitmap(LyXView
> | }
> |
> |
> | +FormMathsBitmap::~FormMathsBitmap()
> | +{
> | + if (!form())
> | + return;
> | +
> | + fl_addto_form(form());
> | + for (vector<bm_ptr>::iterator it = bitmaps_.begin();
> | + it < bitmaps_.end(); ++it) {
> | + FL_OBJECT * obj = it->get();
> | + if (obj) {
> | + fl_delete_object(obj);
> | + fl_free_bmtable_bitmap(obj);
> | + }
> | + }
> | + fl_end_form();
> | +}
> | +
> | +
>
> and fl_free_form is not cutting it?
No, because bmtable is our own invention and it contains a pointer to extra
data structures that fl_free knows nothing about.
typedef struct {
int nx, ny; /**< Dimensions of the table */
int dx, dy; /**< Size of each item */
int bx, by; /**< Bitmap's position */
int bw, bh; /**< Bitmap dimensions */
unsigned char const * bdata; /**< Bitmap data */
int maxi; /**< Number of items */
int i; /**< Current position */
int mousebut; /**< mouse button pushed */
Pixmap pix; /**< Pixmap from data (temporal) */
} BMTABLE_SPEC;
As I understand it, we need to free memory associated with bdata (and also
any memory used by X to display the pixmap). That's what
fl_free_bmtable_bitmap does.
Angus