Kaydet (Commit) 4ff08756 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Björn Michaelsen

update badstatics plugin to look for VclPtr<> statics

maybe we should create a "StaticVclPtr<>" class that checks if VCL is
still "alive" before destructing the object?

Change-Id: If8619f689c29294efa19c37ec782fa07acec728d
Reviewed-on: https://gerrit.libreoffice.org/24085Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Reviewed-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
üst 7ac9973d
......@@ -51,6 +51,7 @@ public:
if ( type.Class("Image").GlobalNamespace()
|| type.Class("Bitmap").GlobalNamespace()
|| type.Class("BitmapEx").GlobalNamespace()
|| type.Class("VclPtr").GlobalNamespace()
)
{
return std::make_pair(true, chain);
......@@ -145,6 +146,22 @@ public:
{
return true;
}
// TODO: check these VclPtr<> static fields
if ( name == "xPreviousWindow" // vcl/source/window/winproc.cxx
|| name == "vDev" // sdext/source/pdfimport/wrapper/wrapper.cxx
|| name == "s_xEmptyController" // svx/source/fmcomp/gridcell.cxx
|| name == "xCell" // svx/source/table/svdotable.cxx
|| name == "pPixOut" // sw/source/core/txtnode/fntcache.cxx
|| name == "mpCareWindow" // sw/source/core/view/viewsh.cxx
)
{
return true;
}
// ignore pointers, nothing happens to them on shutdown
QualType const pCanonical(pVarDecl->getType().getUnqualifiedType().getCanonicalType());
if (pCanonical->isPointerType()) {
return true;
}
std::vector<FieldDecl const*> pad;
auto const ret(isBadStaticType(pVarDecl->getType(), pad,
std::vector<QualType>()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment