Fixed segfault with ordered list

This commit is contained in:
Yousef Khadadeh 2025-12-15 16:49:51 +03:00
parent 7d1671229b
commit 5daf1ce6c0
7 changed files with 24 additions and 2 deletions

View file

@ -95,6 +95,19 @@ void DrawingProgram::clear_draw_cache() {
selection.clear_own_cached_surfaces();
}
void DrawingProgram::write_components_server(cereal::PortableBinaryOutputArchive& a) {
components.write_create_message(a);
}
void DrawingProgram::read_components_client(cereal::PortableBinaryInputArchive& a) {
components = world.netObjMan.read_create_message<NetworkingObjects::NetObjOrderedList<CanvasComponentContainer>>(a, nullptr);
parallel_loop_all_components([&](const auto& c){
c->obj->commit_update_dont_invalidate_cache(*this);
});
compCache.test_rebuild(components->get_data(), true);
set_component_list_callbacks();
}
void DrawingProgram::toolbar_gui() {
Toolbar& t = world.main.toolbar;
t.gui.push_id("Drawing Program Toolbar GUI");

View file

@ -31,6 +31,8 @@ class DrawingProgram {
void update();
void scale_up(const WorldScalar& scaleUpAmount);
void draw(SkCanvas* canvas, const DrawData& drawData);
void write_components_server(cereal::PortableBinaryOutputArchive& a);
void read_components_client(cereal::PortableBinaryInputArchive& a);
std::unordered_set<ServerClientID> get_used_resources() const;
void load_file(cereal::PortableBinaryInputArchive& a, VersionNumber version);