haiku/headers/os
Adrien Destugues 6d9c0146a5 BGradient: fix assignment operator, add copy constructor
The BGradient class is a bit strange as it can store any gradient on its
own, butonly the subclasses allow to set some of the fields.

In the asignment operator, the non-base data (which is in an union) was
not copied over.

More importantly, the missing copy constructor led to the default
implementation being used, and BList (used for the color stops) was
being copied using its default copy constructor, resulting in the two
BGradient (original and copy) poinitng to the same stops data. Heap
corruption resulted whenever one of them was deleted.

Having a working copy ocnstructor fixes this. The alternative is making
the copy constructor private or protected to make sure gradients are not
copied, since normally you'd copy only the subclasses, preserving the
C++ type. However there is nothing enforcing that, and manipulating a
BGradient copied from a subclass works just fine.

Change-Id: I28e733eb8a2970b76ae623eabb75ef8435f508af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3144
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-11 20:46:34 +00:00
..
add-ons Tracker: Allow add-ons to dynamically extend popup menu. 2018-07-19 14:00:48 +00:00
app RosterPrivate: add IsShutDownInProgress() 2019-12-21 20:32:31 +00:00
arch arm64: Add more headers for code compilation 2019-09-01 03:02:49 +00:00
be_apps be_apps/ServicesDaemon: Remove. 2016-07-29 18:41:30 -04:00
bluetooth bluetooth: ioctls always pass size on Haiku. 2018-11-18 14:42:09 -05:00
device Revert r42812. As pointed by Michael, one can use 2011-10-24 21:02:14 +00:00
drivers block_cache: Change signature of *_etc() functions 2020-06-20 18:10:03 +00:00
game More build fixes. 2020-01-25 21:35:34 +01:00
interface BGradient: fix assignment operator, add copy constructor 2020-08-11 20:46:34 +00:00
kernel arm64: Add more headers for code compilation 2019-09-01 03:02:49 +00:00
locale BCountry: add SetTo and InitCheck. 2019-12-02 12:32:15 +00:00
mail Migrate the BMailComponent docs to the Haiku Book. 2017-12-25 19:43:51 -05:00
media PVS V522: null pointer dereferences 2019-07-16 20:44:32 +00:00
midi Fix clang warning "mismatched-tags" 2020-03-23 01:30:23 +00:00
midi2 style cleanup 2006-09-21 13:04:59 +00:00
net docs: Add documentation for BUrlProtocolListener 2020-06-20 18:13:33 +00:00
package Package Kit: reduce identifer/base-url confusion 2020-05-09 20:04:50 +00:00
storage Remove Spurious B_BEOS_DATA_DIRECTORY 2017-05-08 22:17:53 +02:00
support PVS V591: non void functions must return something 2019-07-17 01:57:50 +00:00
translation TranslationErrors.h: document as deprecated. 2019-04-15 20:45:19 +02:00
AppKit.h added these master include files for better R5 compatibility when compiling 2002-10-23 13:48:14 +00:00
Be.h Patch by Jorma Karvonen: Add LocaleKit.h header and also add it to Be.h. Thanks! 2010-05-16 16:07:55 +00:00
BeBuild.h Fix build of Haiku on gcc10 host 2020-05-21 01:35:10 +00:00
DeviceKit.h added these master include files for better R5 compatibility when compiling 2002-10-23 13:48:14 +00:00
GameKit.h added these master include files for better R5 compatibility when compiling 2002-10-23 13:48:14 +00:00
InterfaceKit.h added these master include files for better R5 compatibility when compiling 2002-10-23 13:48:14 +00:00
KernelKit.h added these master include files for better R5 compatibility when compiling 2002-10-23 13:48:14 +00:00
LocaleKit.h Remove even more Locale Kit cruft. 2017-07-30 14:46:41 -04:00
MailKit.h added these master include files for better R5 compatibility when compiling 2002-10-23 13:48:14 +00:00
MediaKit.h Make BMediaRecorder public 2017-01-10 21:34:20 +01:00
MidiKit.h added these master include files for better R5 compatibility when compiling 2002-10-23 13:48:14 +00:00
NetKit.h * Rewrote NetKit.h, and added the libnetapi headers. 2008-06-24 09:03:44 +00:00
NetworkKit.h Added the new headers to the NetworkKit.h all-in-one header. 2010-10-27 14:16:19 +00:00
StorageKit.h StorageKit.h still included the Alias.h header file I removed with the previous commit. 2007-07-06 12:52:01 +00:00
SupportKit.h added these master include files for better R5 compatibility when compiling 2002-10-23 13:48:14 +00:00
TranslationKit.h added these master include files for better R5 compatibility when compiling 2002-10-23 13:48:14 +00:00