summaryrefslogtreecommitdiffstats
path: root/src/server/events
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/events')
-rw-r--r--src/server/events/CreateGraph.cpp9
-rw-r--r--src/server/events/CreatePort.cpp3
2 files changed, 10 insertions, 2 deletions
diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp
index 304656af..99b29b66 100644
--- a/src/server/events/CreateGraph.cpp
+++ b/src/server/events/CreateGraph.cpp
@@ -194,8 +194,13 @@ void
CreateGraph::execute(RunContext& context)
{
if (_graph) {
- if (_parent && _compiled_graph) {
- _parent->set_compiled_graph(std::move(_compiled_graph));
+ if (_parent) {
+ if (_compiled_graph) {
+ _parent->set_compiled_graph(std::move(_compiled_graph));
+ }
+ } else {
+ _engine.set_root_graph(_graph);
+ _graph->enable();
}
for (Event* ev : _child_events) {
diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp
index 4e34762a..3adf2f8b 100644
--- a/src/server/events/CreatePort.cpp
+++ b/src/server/events/CreatePort.cpp
@@ -102,6 +102,9 @@ CreatePort::pre_process(PreProcessContext& ctx)
return Event::pre_process_done(Status::PARENT_NOT_FOUND, parent_path);
} else if (!(_graph = dynamic_cast<GraphImpl*>(parent))) {
return Event::pre_process_done(Status::INVALID_PARENT, parent_path);
+ } else if (!_graph->parent() && _engine.activated() &&
+ !_engine.driver()->dynamic_ports()) {
+ return Event::pre_process_done(Status::CREATION_FAILED, _path);
}
const URIs& uris = _engine.world()->uris();