Skip to content

Commit 63748b7

Browse files
authored
Merge pull request #57 from weefuzzy/fix/shared_object_aliasing
Auto-name shared objects without names
2 parents 208c7b1 + 11e4da1 commit 63748b7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

source/include/FluidMaxWrapper.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,20 @@ class FluidMaxWrapper
11191119
0);
11201120
}
11211121

1122+
template <typename CType = Client>
1123+
static std::enable_if_t<!IsThreadedShared<CType>::value>
1124+
checkName(ParamSetType&)
1125+
{}
1126+
1127+
template <typename CType = Client>
1128+
static std::enable_if_t<IsThreadedShared<CType>::value>
1129+
checkName(ParamSetType& params)
1130+
{
1131+
if (params.template get<0>().size() == 0)
1132+
{
1133+
params.template set<0>(std::string(symbol_unique()->s_name), nullptr);
1134+
}
1135+
}
11221136

11231137
void resizeListHandlers(index newSize)
11241138
{
@@ -1307,6 +1321,7 @@ class FluidMaxWrapper
13071321
}
13081322
// process in-box attributes for mutable params
13091323
attr_args_process((t_object*) this, static_cast<short>(ac), av);
1324+
checkName(mParams);
13101325
// return params so this can be called in client initaliser
13111326
return mParams;
13121327
}

0 commit comments

Comments
 (0)