• 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
..
android Loading commit data...
SampleBinary.cs Loading commit data...
SampleBinary.java Loading commit data...
SampleBinary.php Loading commit data...
android_sample.sh Loading commit data...
csharp_sample.sh Loading commit data...
go_sample.sh Loading commit data...
java_sample.sh Loading commit data...
javascript_sample.sh Loading commit data...
monster.fbs Loading commit data...
monster_generated.h Loading commit data...
monsterdata.json Loading commit data...
php_sample.sh Loading commit data...
python_sample.sh Loading commit data...
sample_binary.cpp Loading commit data...
sample_binary.go Loading commit data...
sample_binary.py Loading commit data...
sample_text.cpp Loading commit data...
samplebinary.js Loading commit data...