Skip to content

Commit

Permalink
Merge pull request flucoma#57 from weefuzzy/fix/shared_object_aliasing
Browse files Browse the repository at this point in the history
Auto-name shared objects without names
  • Loading branch information
tremblap authored Oct 26, 2021
2 parents 208c7b1 + 11e4da1 commit 63748b7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions source/include/FluidMaxWrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,20 @@ class FluidMaxWrapper
0);
}

template <typename CType = Client>
static std::enable_if_t<!IsThreadedShared<CType>::value>
checkName(ParamSetType&)
{}

template <typename CType = Client>
static std::enable_if_t<IsThreadedShared<CType>::value>
checkName(ParamSetType& params)
{
if (params.template get<0>().size() == 0)
{
params.template set<0>(std::string(symbol_unique()->s_name), nullptr);
}
}

void resizeListHandlers(index newSize)
{
Expand Down Expand Up @@ -1307,6 +1321,7 @@ class FluidMaxWrapper
}
// process in-box attributes for mutable params
attr_args_process((t_object*) this, static_cast<short>(ac), av);
checkName(mParams);
// return params so this can be called in client initaliser
return mParams;
}
Expand Down

0 comments on commit 63748b7

Please sign in to comment.