mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
fix memory leaks
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21928 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a9efaa00e8
commit
4b465cfc26
@ -224,6 +224,11 @@ void GuiFontLoader::update()
|
||||
}
|
||||
|
||||
|
||||
GuiFontLoader::~GuiFontLoader()
|
||||
{
|
||||
update();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
GuiFontLoader();
|
||||
|
||||
/// Destructor
|
||||
virtual ~GuiFontLoader() {}
|
||||
virtual ~GuiFontLoader();
|
||||
|
||||
virtual void update();
|
||||
virtual bool available(FontInfo const & f);
|
||||
|
@ -52,10 +52,21 @@ GuiToc::GuiToc(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags flags)
|
||||
|
||||
GuiToc::~GuiToc()
|
||||
{
|
||||
clearTocModels();
|
||||
delete widget_;
|
||||
}
|
||||
|
||||
|
||||
void GuiToc::clearTocModels()
|
||||
{
|
||||
const unsigned int size = toc_models_.size();
|
||||
for (unsigned int i = 0; i < size; ++i) {
|
||||
delete toc_models_[i];
|
||||
}
|
||||
toc_models_.clear();
|
||||
}
|
||||
|
||||
|
||||
int GuiToc::getTocDepth(int type)
|
||||
{
|
||||
if (type < 0)
|
||||
@ -134,7 +145,7 @@ bool GuiToc::initialiseParams(string const & data)
|
||||
|
||||
types_.clear();
|
||||
type_names_.clear();
|
||||
toc_models_.clear();
|
||||
clearTocModels();
|
||||
TocList const & tocs = buffer().masterBuffer()->tocBackend().tocs();
|
||||
TocList::const_iterator it = tocs.begin();
|
||||
TocList::const_iterator end = tocs.end();
|
||||
|
@ -72,6 +72,8 @@ private:
|
||||
TocWidget * widget_;
|
||||
///
|
||||
std::vector<TocModel *> toc_models_;
|
||||
///
|
||||
void clearTocModels();
|
||||
|
||||
public:
|
||||
///
|
||||
|
@ -251,6 +251,7 @@ GuiWorkArea::~GuiWorkArea()
|
||||
{
|
||||
buffer_view_->buffer().workAreaManager().remove(this);
|
||||
delete buffer_view_;
|
||||
delete cursor_;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user