diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-29 14:00:00 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-29 14:00:00 +0000 |
commit | 43089142d5d1da5b256a73e0fb417e760f2313d2 (patch) | |
tree | ccdcc9ff287073fa5d7d48e99415e305e405e18b /skia/ext/bitmap_platform_device_win.h | |
parent | 16742caeda452a8523204ce48e2cd5249e24cbd1 (diff) | |
download | chromium_src-43089142d5d1da5b256a73e0fb417e760f2313d2.zip chromium_src-43089142d5d1da5b256a73e0fb417e760f2313d2.tar.gz chromium_src-43089142d5d1da5b256a73e0fb417e760f2313d2.tar.bz2 |
BitmapPlatformDevice multiply-inherits from PlatformDevice and SkDevice, in
that order. However, a newly-created BitmapPlatformDevice is often upcast to
an SkDevice, and owning pointers are stored to it as an SkDevice. All the
relevant destructors are virtual, so it can safely be deleted polymorphically.
However, valgrind doesn't know that, and at program exit some
BitmapPlatformDevices are still reachable only as SkDevices, pointing to the
middle of the BitmapPlatformDevice.
The real solution would be to get rid of the MI, but for now just switching
the base classes around causes valgrind to shut up, since we're now owning
the object through the same pointer that we got from new. This moves the
memory in valgrind from "possibly lost" to "still reachable".
BUG=105744
TEST=see valgrind output, check that errors go away
Review URL: https://chromiumcodereview.appspot.com/9900001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129616 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/bitmap_platform_device_win.h')
-rw-r--r-- | skia/ext/bitmap_platform_device_win.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/skia/ext/bitmap_platform_device_win.h b/skia/ext/bitmap_platform_device_win.h index 5c416a1..b824369 100644 --- a/skia/ext/bitmap_platform_device_win.h +++ b/skia/ext/bitmap_platform_device_win.h @@ -26,7 +26,7 @@ namespace skia { // For us, that other bitmap will become invalid as soon as the device becomes // invalid, which may lead to subtle bugs. Therefore, DO NOT ASSIGN THE // DEVICE'S PIXEL DATA TO ANOTHER BITMAP, make sure you copy instead. -class SK_API BitmapPlatformDevice : public PlatformDevice, public SkDevice { +class SK_API BitmapPlatformDevice : public SkDevice, public PlatformDevice { public: // Factory function. The screen DC is used to create the bitmap, and will not // be stored beyond this function. is_opaque should be set if the caller |