tdf#91575 - CRASH: when "My Macros & Dialogs Standard" window close

Change-Id: Iad4f67e78a0aa4c67f0c450e17278f873944aa23
This commit is contained in:
Noel Grandin
2015-05-26 12:42:44 +02:00
parent 26092f5486
commit dbca69b975
2 changed files with 6 additions and 4 deletions

View File

@@ -184,7 +184,10 @@ void Layout::SplittedSide::dispose()
{ {
aSplitter.disposeAndClear(); aSplitter.disposeAndClear();
for (auto i = vItems.begin(); i != vItems.end(); ++i) for (auto i = vItems.begin(); i != vItems.end(); ++i)
{
i->pSplit.disposeAndClear(); i->pSplit.disposeAndClear();
i->pWin.clear();
}
} }
// Add() -- adds a new window to the side (after construction) // Add() -- adds a new window to the side (after construction)
@@ -223,6 +226,8 @@ void Layout::SplittedSide::Remove (DockingWindow* pWin)
if (iWin == vItems.size()) if (iWin == vItems.size())
return; return;
// remove // remove
vItems[iWin].pSplit.disposeAndClear();
vItems[iWin].pWin.clear();
vItems.erase(vItems.begin() + iWin); vItems.erase(vItems.begin() + iWin);
// if that was the first one, remove the first splitter line // if that was the first one, remove the first splitter line
if (iWin == 0 && !vItems.empty()) if (iWin == 0 && !vItems.empty())

View File

@@ -61,7 +61,6 @@ protected:
void Remove (DockingWindow*); void Remove (DockingWindow*);
bool HasSize () const { return !bFirstSize; } bool HasSize () const { return !bFirstSize; }
protected:
// Window: // Window:
virtual void Resize () SAL_OVERRIDE; virtual void Resize () SAL_OVERRIDE;
virtual void DataChanged (DataChangedEvent const& rDCEvt) SAL_OVERRIDE; virtual void DataChanged (DataChangedEvent const& rDCEvt) SAL_OVERRIDE;
@@ -117,12 +116,10 @@ private:
VclPtr<Splitter> pSplit; VclPtr<Splitter> pSplit;
}; };
std::vector<Item> vItems; std::vector<Item> vItems;
private:
Point MakePoint (long, long) const; Point MakePoint (long, long) const;
Size MakeSize (long, long) const; Size MakeSize (long, long) const;
private:
static bool IsDocking (DockingWindow const&); static bool IsDocking (DockingWindow const&);
private:
DECL_LINK(SplitHdl, Splitter*); DECL_LINK(SplitHdl, Splitter*);
void CheckMarginsFor (Splitter*); void CheckMarginsFor (Splitter*);
void InitSplitter (Splitter&); void InitSplitter (Splitter&);