summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compilerplugins/clang/vclwidgets.cxx96
-rw-r--r--cui/source/options/optopencl.cxx1
-rw-r--r--cui/source/options/personalization.cxx1
-rw-r--r--cui/source/tabpages/backgrnd.cxx1
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx1
-rw-r--r--filter/source/pdf/impdialog.cxx1
-rw-r--r--fpicker/source/office/RemoteFilesDialog.cxx1
-rw-r--r--fpicker/source/office/iodlg.cxx1
-rw-r--r--sc/source/ui/dbgui/filtdlg.cxx4
-rw-r--r--sc/source/ui/dbgui/scuiimoptdlg.cxx1
-rw-r--r--sc/source/ui/docshell/tpstat.cxx1
-rw-r--r--sc/source/ui/miscdlgs/retypepassdlg.cxx1
-rw-r--r--sc/source/ui/optdlg/calcoptionsdlg.cxx4
-rw-r--r--sfx2/source/dialog/backingwindow.cxx1
-rw-r--r--sfx2/source/doc/saveastemplatedlg.cxx1
-rw-r--r--sfx2/source/doc/templatedlg.cxx4
-rw-r--r--sfx2/source/sidebar/Deck.cxx1
-rw-r--r--starmath/source/dialog.cxx2
-rw-r--r--svtools/source/dialogs/PlaceEditDialog.cxx3
-rw-r--r--svx/source/dialog/compressgraphicdialog.cxx2
-rw-r--r--svx/source/engine3d/float3d.cxx76
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.cxx1
-rw-r--r--sw/source/ui/config/optpage.cxx1
-rw-r--r--sw/source/ui/dbui/mmresultdialogs.cxx2
-rw-r--r--sw/source/ui/envelp/envlop1.cxx1
-rw-r--r--sw/source/ui/envelp/envprt.cxx1
-rw-r--r--sw/source/ui/frmdlg/column.cxx1
-rw-r--r--sw/source/ui/misc/bookmark.cxx1
-rw-r--r--uui/source/authfallbackdlg.cxx1
-rw-r--r--vcl/source/control/menubtn.cxx1
-rw-r--r--vcl/source/control/notebookbar.cxx1
-rw-r--r--vcl/source/outdev/outdev.cxx3
-rw-r--r--vcl/source/window/floatwin.cxx7
-rw-r--r--vcl/source/window/layout.cxx1
-rw-r--r--vcl/source/window/menu.cxx2
-rw-r--r--vcl/source/window/menubarwindow.cxx3
-rw-r--r--vcl/source/window/menufloatingwindow.cxx4
-rw-r--r--vcl/source/window/printdlg.cxx2
-rw-r--r--vcl/source/window/syswin.cxx1
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx1
40 files changed, 232 insertions, 7 deletions
diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx
index 368c962a84b7..ba0c0073e798 100644
--- a/compilerplugins/clang/vclwidgets.cxx
+++ b/compilerplugins/clang/vclwidgets.cxx
@@ -12,6 +12,7 @@
#include "plugin.hxx"
#include "compat.hxx"
+#include "check.hxx"
#include "clang/AST/CXXInheritance.h"
// Final goal: Checker for VCL widget references. Makes sure that VCL Window subclasses are properly referenced counted and dispose()'ed.
@@ -371,6 +372,52 @@ bool VCLWidgets::VisitParmVarDecl(ParmVarDecl const * pvDecl)
return true;
}
+
+static void findDisposeAndClearStatements(std::set<const FieldDecl*>& aVclPtrFields, const Stmt *pStmt)
+{
+ if (!pStmt)
+ return;
+ if (isa<CompoundStmt>(pStmt)) {
+ const CompoundStmt *pCompoundStatement = dyn_cast<CompoundStmt>(pStmt);
+ for(const Stmt* pStmt : pCompoundStatement->body()) {
+ findDisposeAndClearStatements(aVclPtrFields, pStmt);
+ }
+ return;
+ }
+ if (isa<ForStmt>(pStmt)) {
+ findDisposeAndClearStatements(aVclPtrFields, dyn_cast<ForStmt>(pStmt)->getBody());
+ return;
+ }
+ if (isa<IfStmt>(pStmt)) {
+ findDisposeAndClearStatements(aVclPtrFields, dyn_cast<IfStmt>(pStmt)->getThen());
+ findDisposeAndClearStatements(aVclPtrFields, dyn_cast<IfStmt>(pStmt)->getElse());
+ return;
+ }
+ if (!isa<CallExpr>(pStmt)) return;
+ const CallExpr *pCallExpr = dyn_cast<CallExpr>(pStmt);
+
+ if (!pCallExpr->getDirectCallee()) return;
+ if (!isa<CXXMethodDecl>(pCallExpr->getDirectCallee())) return;
+ const CXXMethodDecl *pCalleeMethodDecl = dyn_cast<CXXMethodDecl>(pCallExpr->getDirectCallee());
+ if (pCalleeMethodDecl->getNameAsString() != "disposeAndClear"
+ && pCalleeMethodDecl->getNameAsString() != "clear")
+ return;
+
+ if (!pCallExpr->getCallee()) return;
+
+ if (!isa<MemberExpr>(pCallExpr->getCallee())) return;
+ const MemberExpr *pCalleeMemberExpr = dyn_cast<MemberExpr>(pCallExpr->getCallee());
+
+ if (!pCalleeMemberExpr->getBase()) return;
+ if (!isa<MemberExpr>(pCalleeMemberExpr->getBase())) return;
+ const MemberExpr *pCalleeMemberExprBase = dyn_cast<MemberExpr>(pCalleeMemberExpr->getBase());
+
+ const FieldDecl* xxx = dyn_cast_or_null<FieldDecl>(pCalleeMemberExprBase->getMemberDecl());
+ if (xxx)
+ aVclPtrFields.erase(xxx);
+}
+
+
bool VCLWidgets::VisitFunctionDecl( const FunctionDecl* functionDecl )
{
if (ignoreLocation(functionDecl)) {
@@ -400,6 +447,55 @@ bool VCLWidgets::VisitFunctionDecl( const FunctionDecl* functionDecl )
}
}
+ // check dispose method to make sure we are actually disposing all of the VclPtr fields
+ // FIXME this is not exhaustive. We should enable shouldVisitTemplateInstantiations and look deeper inside type declarations
+ if (pMethodDecl && pMethodDecl->isInstance() && pMethodDecl->getBody()
+ && pMethodDecl->param_size()==0
+ && pMethodDecl->getNameAsString() == "dispose"
+ && isDerivedFromWindow(pMethodDecl->getParent()) )
+ {
+ std::string methodParent = pMethodDecl->getParent()->getNameAsString();
+ if (methodParent == "VirtualDevice" || methodParent == "Breadcrumb")
+ return true;
+
+ std::set<const FieldDecl*> aVclPtrFields;
+ for(const auto& fieldDecl : pMethodDecl->getParent()->fields()) {
+ auto const type = loplugin::TypeCheck(fieldDecl->getType());
+ if (type.Class("VclPtr").GlobalNamespace()) {
+ aVclPtrFields.insert(fieldDecl);
+ } else if (type.Class("vector").StdNamespace()
+ || type.Class("map").StdNamespace()
+ || type.Class("list").StdNamespace()
+ || type.Class("set").StdNamespace())
+ {
+ const RecordType* recordType = dyn_cast_or_null<RecordType>(fieldDecl->getType()->getUnqualifiedDesugaredType());
+ if (recordType) {
+ auto d = dyn_cast<ClassTemplateSpecializationDecl>(recordType->getDecl());
+ if (d && d->getTemplateArgs().size()>0) {
+ auto const type = loplugin::TypeCheck(d->getTemplateArgs()[0].getAsType());
+ if (type.Class("VclPtr").GlobalNamespace()) {
+ aVclPtrFields.insert(fieldDecl);
+ }
+ }
+ }
+ }
+ }
+ if (!aVclPtrFields.empty()) {
+ findDisposeAndClearStatements( aVclPtrFields, pMethodDecl->getBody() );
+ if (!aVclPtrFields.empty()) {
+ //pMethodDecl->dump();
+ std::string aMessage = BASE_REF_COUNTED_CLASS " subclass dispose() method does not call disposeAndClear() or clear() on the following field(s): ";
+ for(auto s : aVclPtrFields)
+ aMessage += ", " + s->getNameAsString();
+ report(
+ DiagnosticsEngine::Warning,
+ aMessage,
+ functionDecl->getLocStart())
+ << functionDecl->getSourceRange();
+ }
+ }
+ }
+
return true;
}
diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx
index cbe37dd6ed54..b24d4ceb3c27 100644
--- a/cui/source/options/optopencl.cxx
+++ b/cui/source/options/optopencl.cxx
@@ -70,6 +70,7 @@ void SvxOpenCLTabPage::dispose()
mpUseSwInterpreter.clear();
mpUseOpenCL.clear();
+ clUsed.clear();
SfxTabPage::dispose();
}
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index 44ed7ebe58f8..ffd2adc10cf1 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -311,6 +311,7 @@ void SvxPersonalizationTabPage::dispose()
m_pExtensionPersonaPreview.clear();
m_pPersonaList.clear();
m_pExtensionLabel.clear();
+ m_pAppliedThemeLabel.clear();
SfxTabPage::dispose();
}
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index e9d69c1a5366..906f1649d272 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -417,6 +417,7 @@ void SvxBackgroundTabPage::dispose()
m_pTblLBox.clear();
m_pBackGroundColorFrame.clear();
m_pBackgroundColorSet.clear();
+ m_pBackGroundColorLabelFT.clear();
m_pPreviewWin1.clear();
m_pBtnPreview.clear();
m_pBitmapContainer.clear();
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 1ea84c316836..f08e94b2bfbd 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -196,6 +196,7 @@ void OJoinTableView::dispose()
m_pSelectedConn.clear();
m_pLastFocusTabWin.clear();
m_pView.clear();
+ m_vTableConnection.clear();
vcl::Window::dispose();
}
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index e53473d2ddab..eb089d38f4c7 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1746,6 +1746,7 @@ void ImpPDFTabSigningPage::dispose()
mpEdSignLocation.clear();
mpEdSignContactInfo.clear();
mpEdSignReason.clear();
+ mpLBSignTSA.clear();
SfxTabPage::dispose();
}
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 56beb4dc395d..69ededf352fe 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -355,6 +355,7 @@ void RemoteFilesDialog::dispose()
m_pNewFolder.clear();
m_pIconView_btn.clear();
m_pListView_btn.clear();
+ m_pAddMenu.clear();
ModalDialog::dispose();
}
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index fa15ec91bfac..251bd1352a23 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -527,6 +527,7 @@ void SvtFileDialog::dispose()
_pCbSelection.clear();
_pPbPlay.clear();
_pPrevWin.clear();
+ m_aDisabledControls.clear();
ModalDialog::dispose();
}
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 47d7fd163afa..81de508a3a82 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -156,6 +156,10 @@ void ScFilterDlg::dispose()
pBtnDestPers.clear();
pFtDbAreaLabel.clear();
pFtDbArea.clear();
+ maValueEdArr.clear();
+ maFieldLbArr.clear();
+ maCondLbArr.clear();
+ maConnLbArr.clear();
ScAnyRefDlg::dispose();
}
diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx
index a32b3615a927..4b3b95e416ce 100644
--- a/sc/source/ui/dbgui/scuiimoptdlg.cxx
+++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx
@@ -249,6 +249,7 @@ void ScImportOptionsDlg::dispose()
{
delete pFieldSepTab;
delete pTextSepTab;
+ m_pEncGrid.clear();
m_pFieldFrame.clear();
m_pFtCharset.clear();
m_pLbCharset.clear();
diff --git a/sc/source/ui/docshell/tpstat.cxx b/sc/source/ui/docshell/tpstat.cxx
index 2675f2834263..9fc5bf9312c9 100644
--- a/sc/source/ui/docshell/tpstat.cxx
+++ b/sc/source/ui/docshell/tpstat.cxx
@@ -66,6 +66,7 @@ void ScDocStatPage::dispose()
m_pFtTables.clear();
m_pFtCells.clear();
m_pFtPages.clear();
+ m_pFtFormula.clear();
SfxTabPage::dispose();
}
diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx
index 8730f29fc13c..124a4efde3e9 100644
--- a/sc/source/ui/miscdlgs/retypepassdlg.cxx
+++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx
@@ -60,6 +60,7 @@ void ScRetypePassDlg::dispose()
mpTextDocStatus.clear();
mpBtnRetypeDoc.clear();
mpSheetsBox.clear();
+ maSheets.clear();
ModalDialog::dispose();
}
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index a62900cb366f..59422660f961 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -142,6 +142,10 @@ ScCalcOptionsDialog::~ScCalcOptionsDialog()
void ScCalcOptionsDialog::dispose()
{
+ mpEmptyAsZero.clear();
+ mpConversion.clear();
+ mpSyntax.clear();
+ mpCurrentDocOnly.clear();
mpUseOpenCL.clear();
mpSpinButton.clear();
mpEditField.clear();
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index ef27a2dc02f2..24f3bf0bdf93 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -190,6 +190,7 @@ void BackingWindow::dispose()
mxDropTargetListener.clear();
}
disposeBuilder();
+ maDndWindows.clear();
mpOpenButton.clear();
mpRemoteButton.clear();
mpRecentButton.clear();
diff --git a/sfx2/source/doc/saveastemplatedlg.cxx b/sfx2/source/doc/saveastemplatedlg.cxx
index 3042b4bc9a88..2822e998c402 100644
--- a/sfx2/source/doc/saveastemplatedlg.cxx
+++ b/sfx2/source/doc/saveastemplatedlg.cxx
@@ -66,6 +66,7 @@ void SfxSaveAsTemplateDialog::dispose()
mpLBCategory.clear();
mpTemplateNameEdit.clear();
mpOKButton.clear();
+ mpCBXDefault.clear();
ModalDialog::dispose();
}
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 5973eb02bcff..08a5709adb53 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -286,6 +286,8 @@ void SfxTemplateManagerDlg::dispose()
mpActionBar.clear();
mpSearchView.clear();
mpLocalView.clear();
+ mpActionMenu.clear();
+ mpTemplateDefaultMenu.clear();
ModalDialog::dispose();
}
@@ -1314,6 +1316,8 @@ void SfxTemplateCategoryDialog::dispose()
mpLBCategory.clear();
mpNewCategoryEdit.clear();
mpOKButton.clear();
+ mpSelectLabel.clear();
+ mpCreateLabel.clear();
ModalDialog::dispose();
}
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 2276b02ac54f..989c9ae9b94e 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -82,6 +82,7 @@ void Deck::dispose()
for (VclPtr<Panel> & rpPanel : aPanels)
rpPanel.disposeAndClear();
+ maPanels.clear(); // just to keep the loplugin:vclwidgets happy
mpTitleBar.disposeAndClear();
mpFiller.disposeAndClear();
mpVerticalScrollBar.disposeAndClear();
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 6be8a2676449..d5fe1435b2e2 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -570,6 +570,7 @@ void SmFontTypeDialog::dispose()
m_pFixedFont.clear();
m_pMenuButton.clear();
m_pDefaultButton.clear();
+ pFontListDev.clear();
ModalDialog::dispose();
}
@@ -1576,6 +1577,7 @@ void SmSymbolDialog::dispose()
m_pSymbolDisplay.clear();
m_pGetBtn.clear();
m_pEditBtn.clear();
+ pFontListDev.clear();
ModalDialog::dispose();
}
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index c0543806d967..837a13cf986f 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -128,6 +128,9 @@ void PlaceEditDialog::dispose()
m_pBTDelete.clear();
m_pEDPassword.clear();
m_pFTPasswordLabel.clear();
+ m_pCBPassword.clear();
+ m_pBTRepoRefresh.clear();
+ m_pTypeGrid.clear();
ModalDialog::dispose();
}
diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx
index 7ece622ed7bf..7dedc172fc18 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -85,6 +85,8 @@ void CompressGraphicsDialog::dispose()
m_pQualityMF.clear();
m_pBtnCalculate.clear();
m_pInterpolationCombo.clear();
+ m_pCompressionSlider.clear();
+ m_pQualitySlider.clear();
ModalDialog::dispose();
}
diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx
index a1044fa1c840..962b6c42c22a 100644
--- a/svx/source/engine3d/float3d.cxx
+++ b/svx/source/engine3d/float3d.cxx
@@ -344,6 +344,82 @@ void Svx3DWin::dispose()
m_pBtnMaterial.clear();
m_pBtnUpdate.clear();
m_pBtnAssign.clear();
+ m_pFLGeometrie.clear();
+ m_pFtPercentDiagonal.clear();
+ m_pMtrPercentDiagonal.clear();
+ m_pFtBackscale.clear();
+ m_pMtrBackscale.clear();
+ m_pFtEndAngle.clear();
+ m_pMtrEndAngle.clear();
+ m_pFtDepth.clear();
+ m_pMtrDepth.clear();
+ m_pFLSegments.clear();
+ m_pNumHorizontal.clear();
+ m_pNumVertical.clear();
+ m_pFLNormals.clear();
+ m_pBtnNormalsObj.clear();
+ m_pBtnNormalsFlat.clear();
+ m_pBtnNormalsSphere.clear();
+ m_pBtnNormalsInvert.clear();
+ m_pBtnTwoSidedLighting.clear();
+ m_pBtnDoubleSided.clear();
+ m_pFLRepresentation.clear();
+ m_pLbShademode.clear();
+ m_pFLShadow.clear();
+ m_pBtnShadow3d.clear();
+ m_pFtSlant.clear();
+ m_pMtrSlant.clear();
+ m_pFLCamera.clear();
+ m_pMtrDistance.clear();
+ m_pMtrFocalLength.clear();
+ m_pFLLight.clear();
+ m_pBtnLight1.clear();
+ m_pBtnLight2.clear();
+ m_pBtnLight3.clear();
+ m_pBtnLight4.clear();
+ m_pBtnLight5.clear();
+ m_pBtnLight6.clear();
+ m_pBtnLight7.clear();
+ m_pBtnLight8.clear();
+ m_pLbLight1.clear();
+ m_pLbLight2.clear();
+ m_pLbLight3.clear();
+ m_pLbLight4.clear();
+ m_pLbLight5.clear();
+ m_pLbLight6.clear();
+ m_pLbLight7.clear();
+ m_pLbLight8.clear();
+ m_pBtnLightColor.clear();
+ m_pLbAmbientlight.clear();
+ m_pBtnAmbientColor.clear();
+ m_pFLTexture.clear();
+ m_pBtnTexLuminance.clear();
+ m_pBtnTexColor.clear();
+ m_pBtnTexReplace.clear();
+ m_pBtnTexModulate.clear();
+ m_pBtnTexBlend.clear();
+ m_pBtnTexObjectX.clear();
+ m_pBtnTexParallelX.clear();
+ m_pBtnTexCircleX.clear();
+ m_pBtnTexObjectY.clear();
+ m_pBtnTexParallelY.clear();
+ m_pBtnTexCircleY.clear();
+ m_pBtnTexFilter.clear();
+ m_pFLMaterial.clear();
+ m_pLbMatFavorites.clear();
+ m_pLbMatColor.clear();
+ m_pBtnMatColor.clear();
+ m_pLbMatEmission.clear();
+ m_pBtnEmissionColor.clear();
+ m_pFLMatSpecular.clear();
+ m_pLbMatSpecular.clear();
+ m_pBtnSpecularColor.clear();
+ m_pMtrMatSpecularIntensity.clear();
+ m_pCtlPreview.clear();
+ m_pCtlLightPreview.clear();
+ m_pBtnConvertTo3D.clear();
+ m_pBtnLatheObject.clear();
+ m_pBtnPerspective.clear();
SfxDockingWindow::dispose();
}
diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx
index e9c8d965a17c..b8afb5e750de 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.cxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.cxx
@@ -84,6 +84,7 @@ void TextPropertyPanel::dispose()
mpToolBoxSpacing.clear();
mpToolBoxFontColorSw.clear();
mpToolBoxFontColor.clear();
+ mpToolBoxBackgroundColor.clear();
maFontSizeControl.dispose();
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 89768422652a..fe6f35370829 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -622,6 +622,7 @@ void SwStdFontTabPage::dispose()
m_pIdxBox.clear();
m_pIndexHeightLB.clear();
m_pStandardPB.clear();
+ m_pPrt.clear();
SfxTabPage::dispose();
}
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx
index ded703083408..66bb81a65e80 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -309,6 +309,7 @@ void SwMMResultPrintDialog::dispose()
m_pToFT.clear();
m_pToNF.clear();
m_pOKButton.clear();
+ m_pTempPrinter.clear();
SfxModalDialog::dispose();
}
@@ -371,6 +372,7 @@ void SwMMResultEmailDialog::dispose()
m_pToFT.clear();
m_pToNF.clear();
m_pOKButton.clear();
+ m_pSendAsPB.clear();
SfxModalDialog::dispose();
}
diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx
index 41efae3a3dbd..398de3dab700 100644
--- a/sw/source/ui/envelp/envlop1.cxx
+++ b/sw/source/ui/envelp/envlop1.cxx
@@ -156,6 +156,7 @@ void SwEnvDlg::dispose()
{
delete pAddresseeSet;
delete pSenderSet;
+ pPrinter.clear();
SfxTabDialog::dispose();
}
diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx
index 5ff8a10eeef6..d57ba17eb9ce 100644
--- a/sw/source/ui/envelp/envprt.cxx
+++ b/sw/source/ui/envelp/envprt.cxx
@@ -80,6 +80,7 @@ void SwEnvPrtPage::dispose()
m_pDownField.clear();
m_pPrinterInfo.clear();
m_pPrtSetup.clear();
+ pPrt.clear();
SfxTabPage::dispose();
}
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index f1575fedc870..ab412bb3c880 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -581,6 +581,7 @@ void SwColumnPage::dispose()
m_pTextDirectionLB.clear();
m_pPgeExampleWN.clear();
m_pFrameExampleWN.clear();
+ m_aPercentFieldsMap.clear();
SfxTabPage::dispose();
}
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 1dd1666465f4..bdbe2c680e79 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -331,6 +331,7 @@ void SwInsertBookmarkDlg::dispose()
m_pDeleteBtn.clear();
m_pGotoBtn.clear();
m_pEditBox.clear();
+ m_pRenameBtn.clear();
SvxStandardDialog::dispose();
}
diff --git a/uui/source/authfallbackdlg.cxx b/uui/source/authfallbackdlg.cxx
index db0448e551ae..89110740993b 100644
--- a/uui/source/authfallbackdlg.cxx
+++ b/uui/source/authfallbackdlg.cxx
@@ -56,6 +56,7 @@ void AuthFallbackDlg::dispose()
m_pEDCode.clear();
m_pBTOk.clear();
m_pBTCancel.clear();
+ m_pFTGooglePrefixLabel.clear();
ModalDialog::dispose();
}
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx
index 2db2bd060fa7..28f5ffcba8ec 100644
--- a/vcl/source/control/menubtn.cxx
+++ b/vcl/source/control/menubtn.cxx
@@ -87,6 +87,7 @@ MenuButton::~MenuButton()
void MenuButton::dispose()
{
delete mpMenuTimer;
+ mpMenu.clear();
PushButton::dispose();
}
diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx
index c100a625c445..413cb57c6a79 100644
--- a/vcl/source/control/notebookbar.cxx
+++ b/vcl/source/control/notebookbar.cxx
@@ -49,6 +49,7 @@ void NotebookBar::dispose()
{
disposeBuilder();
m_pEventListener.clear();
+ m_pTabControl.clear();
Control::dispose();
}
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index b1bd83ab5662..04d1210ca690 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -208,7 +208,8 @@ void OutputDevice::dispose()
}
mpAlphaVDev.disposeAndClear();
-
+ mpPrevGraphics.clear();
+ mpNextGraphics.clear();
VclReferenceBase::dispose();
}
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 38d9a91be4cb..627cb6e6e65d 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -201,11 +201,7 @@ void FloatingWindow::ApplySettings(vcl::RenderContext& rRenderContext)
FloatingWindow::~FloatingWindow()
{
disposeOnce();
-
- // Unfortunately the vclwidgets clang plug-in says: "OutputDevice
- // subclass should have nothing in its destructor but a call to
- // disposeOnce()."
- // assert (!mnPostId);
+ assert (!mnPostId);
}
void FloatingWindow::dispose()
@@ -230,6 +226,7 @@ void FloatingWindow::dispose()
mpNextFloat.clear();
mpFirstPopupModeWin.clear();
+ mxPrevFocusWin.clear();
SystemWindow::dispose();
}
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 50232d2e7606..e48a78d7e57b 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -2055,6 +2055,7 @@ void MessageDialog::dispose()
m_pGrid.disposeAndClear();
m_pOwnedActionArea.disposeAndClear();
m_pOwnedContentArea.disposeAndClear();
+ m_aResponses.clear();
Dialog::dispose();
}
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index f146be47f48d..b3b2bc1e8fb0 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -182,6 +182,8 @@ void Menu::dispose()
// Native-support: destroy SalMenu
ImplSetSalMenu( nullptr );
+ pStartedFrom.clear();
+ pWindow.clear();
VclReferenceBase::dispose();
}
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index 906459c420e9..b2a5b808f534 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -170,6 +170,9 @@ void MenuBarWindow::dispose()
aHideBtn.disposeAndClear();
aFloatBtn.disposeAndClear();
aCloseBtn.disposeAndClear();
+ pMenu.clear();
+ pActivePopup.clear();
+ xSaveFocusId.clear();
Window::dispose();
}
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index 21337acc8723..022eac2e4123 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -115,7 +115,9 @@ MenuFloatingWindow::~MenuFloatingWindow()
void MenuFloatingWindow::dispose()
{
doShutdown();
-
+ pMenu.clear();
+ pActivePopup.clear();
+ xSaveFocusId.clear();
FloatingWindow::dispose();
}
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index e61d164a5e43..f8d51a006293 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -735,6 +735,8 @@ void PrintDialog::dispose()
mpCancelButton.clear();
mpHelpButton.clear();
maPController.reset();
+ maControlToPropertyMap.clear();
+ maControlToNumValMap.clear();
ModalDialog::dispose();
}
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 54f40accca2f..242b98a1826c 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -112,6 +112,7 @@ void SystemWindow::dispose()
mpWindowImpl->mbSysWin = false;
disposeBuilder();
mpDialogParent.clear();
+ mpMenuBar.clear();
Window::dispose();
}
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx
index ce92dfd4a0e5..62ec941220c7 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -89,6 +89,7 @@ void CertificateChooser::dispose()
m_pCertLB.disposeAndClear();
m_pViewBtn.clear();
m_pOKBtn.clear();
+ m_pDescriptionED.clear();
ModalDialog::dispose();
}