Amerio.Stephane Posted October 3, 2018 Share Posted October 3, 2018 Hello, Crash confirmed even with the CIGI demo and HEmu: create Ownship entity 0 with type 118 (Be200) remove entity 0 create Ownship entity 0 with type 0 (or anything different than the first declaration) => crash (it doesn't crash if ownship is recreated with the same type) This use-case is actually used here, when we change from one simulation to another with a different ownship type, without restarting the IG. Link to comment
alexander Posted October 4, 2018 Share Posted October 4, 2018 Hi Amerio, I fixed the bug. Please open <SDK Browser>/sdks/<SDK VERSION>/source/plugins/Network/CigiClient/architecture/Entity.cpp file and add one line: void Cigi::Entity::setState(STATE in_state) { if (state == in_state) return; state = in_state; // ADD THIS LINE! if (!node) return; } It will fixed that bug: https://developer.unigine.com/forum/topic/5105-cigi-destroy-component-callback-is-never-called/ Next, open <SDK Browser>/sdks/<SDK VERSION>/source/plugins/Network/Syncker/source/SynckerMaster.cpp file and add this: void Master::deleteNode(const NodePtr &node, int include_children) { // ... // instead of this: // if (nodes_interpolation->isExist(node)) // nodes_interpolation->removeNode(node); // put this: int sync_index = sync_nodes.findIndex(node); if (sync_index != -1) removeSyncNode(sync_index); // ... } It will fix the crash. Best regards, Alexander Link to comment
Amerio.Stephane Posted October 4, 2018 Author Share Posted October 4, 2018 Hello, For the callback, after applying the patch and replacing the correct binary, it still doesn't call the destroy callback :( Am i missing something? For the crash, it does fix it, al least partially. I still get an access violation in some cases. Now I'm trying to narrow it. Link to comment
alexander Posted October 10, 2018 Share Posted October 10, 2018 Hi, Am i missing something? Sorry, my bad. Open and modify the <SDK Browser>/sdks/<SDK VERSION>/source/plugins/Network/CigiClient/architecture/Entity.cpp file: void Cigi::Entity::setType(int in_type) { if (type == in_type) return; // run callback if (on_before_change_type) on_before_change_type->run(this); //type = in_type; // REMOVE THIS LINE!!! node->setName(String::format("cigi_entity_dummy (id: %d type: %d)", entity_id, type).get()); // destroy old noderef (if it was created) if (node_ref) node_ref.destroy(); // destroy all components and articulated parts, attached to this entity type destroy_all(); type = in_type; // ADD THIS LINE!!! auto et = entity_types.find(type); if (et == entity_types.end()) return; // ... // ... // ... (change position of the "type = in_type" line) Best regards, Alexander 1 Link to comment
Amerio.Stephane Posted October 10, 2018 Author Share Posted October 10, 2018 It works now ! Thanks a lot ! Link to comment
Recommended Posts