• Wouter van Oortmerssen's avatar
    Add ::Set function to Unions to make memory ownership clear. · c66683f2
    Wouter van Oortmerssen authored
    Unions own the NativeTable* value member because they need to destroy them
    when the Union goes out of scope.  Currently, the data is destroyed by calling
    delete, which means that the member needs to be allocated with new.  However,
    making the allocation the responsibility of the client and the destruction
    the responsibility of the Union can lead to potential errors.  Adding a
    Set function will ensure that the memory is allocated correctly so that it
    can be deleted later.
    
    From cl/142161569.
    
    Change-Id: I4605f26d2749164819bfae0140e5fae08442b50a
    c66683f2
Name
Last commit
Last update
CMake Loading commit data...
android Loading commit data...
biicode Loading commit data...
docs Loading commit data...
go Loading commit data...
grpc Loading commit data...
include/flatbuffers Loading commit data...
java/com/google/flatbuffers Loading commit data...
js Loading commit data...
net/FlatBuffers Loading commit data...
php Loading commit data...
python Loading commit data...
reflection Loading commit data...
samples Loading commit data...
src Loading commit data...
tests Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CMakeLists.txt Loading commit data...
CONTRIBUTING.md Loading commit data...
ISSUE_TEMPLATE.md Loading commit data...
LICENSE.txt Loading commit data...
appveyor.yml Loading commit data...
biicode.conf Loading commit data...
composer.json Loading commit data...
pom.xml Loading commit data...
readme.md Loading commit data...