Merge remote-tracking branch 'origin/main' into develop

This commit is contained in:
Mike Bierlee 2024-06-17 00:28:06 +03:00
commit d2d4184af6

View file

@ -309,12 +309,14 @@ class AutowiredRegistration(RegistrationType : Object) : Registration {
private void delegate() getPreDestructor(RegistrationType instance) {
void delegate() preDestructor = null;
static foreach (memberName; __traits(allMembers, RegistrationType)) {
static foreach (overload; __traits(getOverloads, RegistrationType, memberName)) {
static if (__traits(compiles, __traits(getProtection, overload))
&& __traits(getProtection, overload) == "public"
&& isFunction!overload
&& hasUDA!(overload, PreDestroy)) {
preDestructor = &__traits(getMember, instance, memberName);
static if (__traits(compiles, __traits(getOverloads, RegistrationType, memberName))) {
static foreach (overload; __traits(getOverloads, RegistrationType, memberName)) {
static if (__traits(compiles, __traits(getProtection, overload))
&& __traits(getProtection, overload) == "public"
&& isFunction!overload
&& hasUDA!(overload, PreDestroy)) {
preDestructor = &__traits(getMember, instance, memberName);
}
}
}
}