aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/alignedtextblock.cc1
-rw-r--r--dw/findtext.cc2
-rw-r--r--dw/fltkimgbuf.cc8
-rw-r--r--dw/fltkplatform.cc2
-rw-r--r--dw/fltkviewport.cc1
-rw-r--r--dw/image.cc2
-rw-r--r--dw/layout.cc2
-rw-r--r--dw/listitem.cc1
-rw-r--r--dw/selection.cc1
-rw-r--r--dw/style.cc26
-rw-r--r--dw/style.hh10
-rw-r--r--dw/table.cc2
-rw-r--r--dw/tablecell.cc1
-rw-r--r--dw/textblock.cc6
-rw-r--r--dw/ui.cc1
-rw-r--r--dw/widget.cc4
-rw-r--r--lout/debug.hh24
-rw-r--r--src/dillo.cc1
18 files changed, 81 insertions, 14 deletions
diff --git a/dw/alignedtextblock.cc b/dw/alignedtextblock.cc
index 0d910c93..24dab2e8 100644
--- a/dw/alignedtextblock.cc
+++ b/dw/alignedtextblock.cc
@@ -81,6 +81,7 @@ void AlignedTextblock::setRefTextblock (AlignedTextblock *ref)
AlignedTextblock::~AlignedTextblock()
{
list->unref (listPos);
+ DBG_OBJ_DELETE ();
}
void AlignedTextblock::updateValue ()
diff --git a/dw/findtext.cc b/dw/findtext.cc
index 4390e3ee..cc57e991 100644
--- a/dw/findtext.cc
+++ b/dw/findtext.cc
@@ -47,6 +47,8 @@ FindtextState::~FindtextState ()
delete iterator;
if (hlIterator)
delete hlIterator;
+
+ DBG_OBJ_DELETE ();
}
void FindtextState::setWidget (Widget *widget)
diff --git a/dw/fltkimgbuf.cc b/dw/fltkimgbuf.cc
index d9d653ec..86497160 100644
--- a/dw/fltkimgbuf.cc
+++ b/dw/fltkimgbuf.cc
@@ -85,6 +85,8 @@ FltkImgbuf::FltkImgbuf (Type type, int width, int height, double gamma)
FltkImgbuf::FltkImgbuf (Type type, int width, int height, double gamma,
FltkImgbuf *root)
{
+ DBG_OBJ_CREATE ("dw::fltk::FltkImgbuf");
+
_MSG("FltkImgbuf: new scaled %p, root is %p\n", this, root);
init (type, width, height, gamma, root);
}
@@ -156,8 +158,6 @@ void FltkImgbuf::init (Type type, int width, int height, double gamma,
FltkImgbuf::~FltkImgbuf ()
{
- _MSG("~FltkImgbuf[%s %p] deleted\n", isRoot() ? "root":"scaled", this);
-
if (!isRoot())
root->detachScaledBuf (this);
@@ -166,6 +166,8 @@ FltkImgbuf::~FltkImgbuf ()
if (scaledBuffers)
delete scaledBuffers;
+
+ DBG_OBJ_DELETE ();
}
/**
@@ -386,6 +388,8 @@ core::Imgbuf* FltkImgbuf::getScaledBuf (int width, int height)
// This size is not yet used, so a new buffer has to be created.
FltkImgbuf *sb = new FltkImgbuf (type, width, height, gamma, this);
scaledBuffers->append (sb);
+ DBG_OBJ_ASSOC_CHILD (sb);
+
return sb;
}
diff --git a/dw/fltkplatform.cc b/dw/fltkplatform.cc
index 2a160d63..9f51eba2 100644
--- a/dw/fltkplatform.cc
+++ b/dw/fltkplatform.cc
@@ -474,6 +474,8 @@ FltkPlatform::~FltkPlatform ()
Fl::remove_idle (generalStaticIdle, (void*)this);
delete idleQueue;
delete resources;
+
+ DBG_OBJ_DELETE ();
}
void FltkPlatform::setLayout (core::Layout *layout)
diff --git a/dw/fltkviewport.cc b/dw/fltkviewport.cc
index 7e91a83a..9603c508 100644
--- a/dw/fltkviewport.cc
+++ b/dw/fltkviewport.cc
@@ -85,6 +85,7 @@ FltkViewport::FltkViewport (int X, int Y, int W, int H, const char *label):
FltkViewport::~FltkViewport ()
{
delete gadgets;
+ DBG_OBJ_DELETE ();
}
void FltkViewport::adjustScrollbarsAndGadgetsAllocation ()
diff --git a/dw/image.cc b/dw/image.cc
index 3aef42ac..1421418e 100644
--- a/dw/image.cc
+++ b/dw/image.cc
@@ -164,6 +164,8 @@ Image::~Image()
buffer->unref ();
if (mapKey)
delete mapKey;
+
+ DBG_OBJ_DELETE ();
}
void Image::sizeRequestImpl (core::Requisition *requisition)
diff --git a/dw/layout.cc b/dw/layout.cc
index f7bd7597..d83b2e8a 100644
--- a/dw/layout.cc
+++ b/dw/layout.cc
@@ -307,6 +307,8 @@ Layout::~Layout ()
delete view;
delete anchorsTable;
delete textZone;
+
+ DBG_OBJ_DELETE ();
}
void Layout::addWidget (Widget *widget)
diff --git a/dw/listitem.cc b/dw/listitem.cc
index 11086a9e..05344d79 100644
--- a/dw/listitem.cc
+++ b/dw/listitem.cc
@@ -37,6 +37,7 @@ ListItem::ListItem (ListItem *ref, bool limitTextWidth):
ListItem::~ListItem()
{
+ DBG_OBJ_DELETE ();
}
void ListItem::initWithWidget (core::Widget *widget,
diff --git a/dw/selection.cc b/dw/selection.cc
index 2201af44..b67f4a6d 100644
--- a/dw/selection.cc
+++ b/dw/selection.cc
@@ -61,6 +61,7 @@ SelectionState::SelectionState ()
SelectionState::~SelectionState ()
{
reset ();
+ DBG_OBJ_DELETE ();
}
void SelectionState::reset ()
diff --git a/dw/style.cc b/dw/style.cc
index 4ab5673a..8a6dd163 100644
--- a/dw/style.cc
+++ b/dw/style.cc
@@ -237,8 +237,20 @@ container::typed::HashTable <StyleAttrs, Style> * Style::styleTable =
Style::Style (StyleAttrs *attrs)
{
+ DBG_OBJ_CREATE ("dw::core::style::Style");
+
copyAttrs (attrs);
+ DBG_OBJ_ASSOC_CHILD (font);
+ DBG_OBJ_ASSOC_CHILD (color);
+ DBG_OBJ_ASSOC_CHILD (backgroundColor);
+ DBG_OBJ_ASSOC_CHILD (backgroundImage);
+ DBG_OBJ_ASSOC_CHILD (borderColor.top);
+ DBG_OBJ_ASSOC_CHILD (borderColor.bottom);
+ DBG_OBJ_ASSOC_CHILD (borderColor.left);
+ DBG_OBJ_ASSOC_CHILD (borderColor.right);
+ DBG_OBJ_ASSOC_CHILD (x_tooltip);
+
refCount = 1;
font->ref ();
@@ -285,6 +297,8 @@ Style::~Style ()
styleTable->remove (this);
totalRef--;
+
+ DBG_OBJ_DELETE ();
}
void Style::copyAttrs (StyleAttrs *attrs)
@@ -356,6 +370,7 @@ int FontAttrs::hashValue()
Font::~Font ()
{
free ((char*)name);
+ DBG_OBJ_DELETE ();
}
void Font::copyAttrs (FontAttrs *attrs)
@@ -399,6 +414,7 @@ int ColorAttrs::hashValue()
Color::~Color ()
{
+ DBG_OBJ_DELETE ();
}
int Color::shadeColor (int color, int d)
@@ -482,6 +498,8 @@ void StyleImage::StyleImgRenderer::setBuffer (core::Imgbuf *buffer, bool resize)
image->imgbufTiled = NULL;
image->imgbufSrc = buffer;
+ DBG_OBJ_ASSOC_CHILD (image->imgbufSrc);
+
if (image->imgbufSrc) {
image->imgbufSrc->ref ();
@@ -506,6 +524,8 @@ void StyleImage::StyleImgRenderer::setBuffer (core::Imgbuf *buffer, bool resize)
image->imgbufSrc->createSimilarBuf
(image->tilesX * image->imgbufSrc->getRootWidth(),
image->tilesY * image->imgbufSrc->getRootHeight());
+
+ DBG_OBJ_ASSOC_CHILD (image->imgbufTiled);
}
}
}
@@ -546,7 +566,7 @@ void StyleImage::StyleImgRenderer::fatal ()
StyleImage::StyleImage ()
{
- //printf ("new StyleImage %p\n", this);
+ DBG_OBJ_CREATE ("dw::core::style::Color");
refCount = 0;
imgbufSrc = NULL;
@@ -559,8 +579,6 @@ StyleImage::StyleImage ()
StyleImage::~StyleImage ()
{
- //printf ("delete StyleImage %p\n", this);
-
if (imgbufSrc)
imgbufSrc->unref ();
if (imgbufTiled)
@@ -568,6 +586,8 @@ StyleImage::~StyleImage ()
delete imgRendererDist;
delete styleImgRenderer;
+
+ DBG_OBJ_DELETE ();
}
void StyleImage::ExternalImgRenderer::setBuffer (core::Imgbuf *buffer,
diff --git a/dw/style.hh b/dw/style.hh
index 089cf59b..7127b6db 100644
--- a/dw/style.hh
+++ b/dw/style.hh
@@ -8,6 +8,7 @@
#endif
#include "../lout/signal.hh"
+#include "../lout/debug.hh"
namespace dw {
namespace core {
@@ -660,7 +661,10 @@ private:
static Font *create0 (Layout *layout, FontAttrs *attrs, bool tryEverything);
protected:
- inline Font () { refCount = 0; }
+ inline Font () {
+ DBG_OBJ_CREATE ("dw::core::style::Font");
+ refCount = 0;
+ }
virtual ~Font ();
void copyAttrs (FontAttrs *attrs);
@@ -712,7 +716,9 @@ private:
protected:
inline Color (int color): ColorAttrs (color) {
- refCount = 0; }
+ DBG_OBJ_CREATE ("dw::core::style::Color");
+ refCount = 0;
+ }
virtual ~Color ();
public:
diff --git a/dw/table.cc b/dw/table.cc
index 8db9ef2a..6fe0da8b 100644
--- a/dw/table.cc
+++ b/dw/table.cc
@@ -98,6 +98,8 @@ Table::~Table()
delete baseline;
delete rowStyle;
delete colPercents;
+
+ DBG_OBJ_DELETE ();
}
void Table::sizeRequestImpl (core::Requisition *requisition)
diff --git a/dw/tablecell.cc b/dw/tablecell.cc
index 5a005e3d..8612f620 100644
--- a/dw/tablecell.cc
+++ b/dw/tablecell.cc
@@ -42,6 +42,7 @@ TableCell::TableCell (TableCell *ref, bool limitTextWidth):
TableCell::~TableCell()
{
+ DBG_OBJ_DELETE ();
}
bool TableCell::wordWrap(int wordIndex, bool wrapAll)
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 8623a574..2c4ca20b 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -313,7 +313,7 @@ Textblock::~Textblock ()
parent class destructor. (???) */
words = NULL;
- //DBG_OBJ_SET_NUM(this, "num_lines", lines->size ());
+ DBG_OBJ_DELETE ();
}
/**
@@ -1932,6 +1932,7 @@ void Textblock::addText0 (const char *text, size_t len, short flags,
Word *word = addWord (size->width, size->ascent, size->descent,
flags, style);
+ DBG_OBJ_ASSOC_CHILD (style);
word->content.type = core::Content::TEXT;
word->content.text = layout->textZone->strndup(text, len);
@@ -2200,6 +2201,7 @@ void Textblock::addParbreak (int space, core::style::Style *style)
}
word = addWord (0, 0, 0, 0, style);
+ DBG_OBJ_ASSOC_CHILD (style);
word->content.type = core::Content::BREAK;
word->badnessAndPenalty.setPenalty (PENALTY_FORCE_BREAK);
word->content.breakSpace = space;
@@ -2223,6 +2225,8 @@ void Textblock::addLinebreak (core::style::Style *style)
// ... otherwise, it has no size (and does not enlarge the line).
word = addWord (0, 0, 0, 0, style);
+ DBG_OBJ_ASSOC_CHILD (style);
+
word->content.type = core::Content::BREAK;
word->badnessAndPenalty.setPenalty (PENALTY_FORCE_BREAK);
word->content.breakSpace = 0;
diff --git a/dw/ui.cc b/dw/ui.cc
index 8963d3bf..22199980 100644
--- a/dw/ui.cc
+++ b/dw/ui.cc
@@ -44,6 +44,7 @@ Embed::Embed(Resource *resource)
Embed::~Embed()
{
delete resource;
+ DBG_OBJ_DELETE ();
}
void Embed::sizeRequestImpl (Requisition *requisition)
diff --git a/dw/widget.cc b/dw/widget.cc
index b09c51e9..385bdb97 100644
--- a/dw/widget.cc
+++ b/dw/widget.cc
@@ -108,6 +108,8 @@ Widget::~Widget ()
parent->removeChild (this);
else
layout->removeWidget ();
+
+ DBG_OBJ_DELETE ();
}
@@ -335,6 +337,8 @@ void Widget::setStyle (style::Style *style)
this->style = style;
+ DBG_OBJ_ASSOC_CHILD (style);
+
if (style && style->backgroundImage) {
// Create instance of WidgetImgRenderer when needed. Until this
// widget is deleted, "widgetImgRenderer" will be kept, since it
diff --git a/lout/debug.hh b/lout/debug.hh
index bbbe401b..e0d66a1b 100644
--- a/lout/debug.hh
+++ b/lout/debug.hh
@@ -76,6 +76,13 @@
fflush (stdout); \
} D_STMT_END
+#define DBG_OBJ_DELETE() \
+ D_STMT_START { \
+ printf (RTFL_PREFIX_FMT "obj-delete:%p\n", \
+ RTFL_PREFIX_ARGS, this); \
+ fflush (stdout); \
+ } D_STMT_END
+
#define DBG_OBJ_BASECLASS(klass) \
D_STMT_START { \
printf (RTFL_PREFIX_FMT "obj-ident:%p:%p\n", \
@@ -85,9 +92,11 @@
#define DBG_OBJ_ASSOC(parent, child) \
D_STMT_START { \
- printf (RTFL_PREFIX_FMT "obj-assoc:%p:%p\n", \
- RTFL_PREFIX_ARGS, parent, child); \
- fflush (stdout); \
+ if (child) { \
+ printf (RTFL_PREFIX_FMT "obj-assoc:%p:%p\n", \
+ RTFL_PREFIX_ARGS, parent, child); \
+ fflush (stdout); \
+ } \
} D_STMT_END
#define DBG_OBJ_ASSOC_PARENT(parent) \
@@ -99,9 +108,11 @@
#define DBG_OBJ_ASSOC_CHILD(child) \
D_STMT_START { \
- printf (RTFL_PREFIX_FMT "obj-assoc:%p:%p\n", \
- RTFL_PREFIX_ARGS, this, child); \
- fflush (stdout); \
+ if (child) { \
+ printf (RTFL_PREFIX_FMT "obj-assoc:%p:%p\n", \
+ RTFL_PREFIX_ARGS, this, child); \
+ fflush (stdout); \
+ } \
} D_STMT_END
#define DBG_OBJ_SET_NUM(var, val) \
@@ -160,6 +171,7 @@
#define DBG_OBJ_MSG_START(obj)
#define DBG_OBJ_MSG_END(obj)
#define DBG_OBJ_CREATE(klass)
+#define DBG_OBJ_DELETE()
#define DBG_OBJ_BASECLASS(klass)
#define DBG_OBJ_ASSOC_PARENT(parent)
#define DBG_OBJ_ASSOC_CHILD(child)
diff --git a/src/dillo.cc b/src/dillo.cc
index 2b9f1645..5a67946b 100644
--- a/src/dillo.cc
+++ b/src/dillo.cc
@@ -379,6 +379,7 @@ int main(int argc, char **argv)
DBG_OBJ_COLOR("#c0ff80", "dw::*");
DBG_OBJ_COLOR("#c0c0ff", "dw::fltk::*");
DBG_OBJ_COLOR("#ffa0a0", "dw::core::*");
+ DBG_OBJ_COLOR("#ffe0a0", "dw::core::style::*");
uint_t opt_id;
uint_t options_got = 0;