napframework / nap

NAP Framework source code
https://nap-framework.tech
Mozilla Public License 2.0
410 stars 23 forks source link

Duplicating nap::StructBuffer breaks on assert #30

Closed lshoek closed 3 months ago

lshoek commented 3 months ago

Can be reproduced in helloworld demo project

assert(src_value.get_type().is_wrapper() && src_value.get_type().get_wrapped_type().is_pointer());
cklosters commented 3 months ago

Well, the assert is correct here: it encounters an embedded object that isn't a pointer to a resource, which shouldn't exist. The current definition of nap::StructBuffer is wrong - the description should not be flagged as embedded because it's a copyable struct, not a nap object. Fixed here: https://github.com/napframework/nap/commit/92b3f6d1d7c24d9d3f9c825d1ca2a63dc285bc5f