Skip to content

Commit

Permalink
Moving invocation of hook to before objects becomes unmarked
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Jul 3, 2017
1 parent 6c020f7 commit 3953ac6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions hpx/runtime/components/server/runtime_support.hpp
Expand Up @@ -806,7 +806,7 @@ namespace hpx { namespace components { namespace server
reinterpret_cast<void**>(&new_instance));

// sanity checks
if (!id)
if (!id || new_instance == nullptr)
{
// we should not get here (id should not be invalid)
HPX_THROW_EXCEPTION(hpx::invalid_status,
Expand All @@ -828,6 +828,9 @@ namespace hpx { namespace components { namespace server
<< " of type: " << components::get_component_type_name(type)
<< " to locality: " << find_here();

// inform the newly created component that it has been migrated
new_instance->on_migrated();

// At this point the object has been fully migrated. We now remove
// the object from the AGAS table of migrated objects. This is
// necessary as this object might have been migrated off this locality
Expand All @@ -836,10 +839,6 @@ namespace hpx { namespace components { namespace server

to_migrate.make_unmanaged();

// inform the newly created component that it has been migrated
if (new_instance != nullptr)
new_instance->on_migrated();

return id;
}
}}}
Expand Down

0 comments on commit 3953ac6

Please sign in to comment.