diff --git a/src/runtime2/global_store.rs b/src/runtime2/global_store.rs index 018fa8e82011bd87902ced460d43bdefb7fc77ae..3b62801458e6cdc055fd273866a2f921da1e3ed0 100644 --- a/src/runtime2/global_store.rs +++ b/src/runtime2/global_store.rs @@ -138,8 +138,10 @@ impl ConnectorStore { } /// Create a new connector, returning the key that can be used to retrieve - /// and/or queue it. - pub(crate) fn create(&self, created_by: &mut ScheduledConnector, connector: ConnectorVariant) -> ConnectorKey { + /// and/or queue it. The caller must make sure that the constructed + /// connector's code is initialized with the same ports as the ports in the + /// `initial_ports` array. + pub(crate) fn create(&self, created_by: &mut ScheduledConnector, connector: ConnectorVariant, initial_ports: Vec) -> ConnectorKey { // Creation of the connector in the global store, requires a lock { let lock = self.inner.write().unwrap(); @@ -181,7 +183,6 @@ impl ConnectorStore { ConnectorVariant::UserDefined(connector) => { for port_id in &connector.ports.owned_ports { let mut port = created_by.context.remove_port(*port_id); - port.owning_connector = new_connector.context.id; new_connector.context.add_port(port); } },