Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Bierlee committed Jun 16, 2024
2 parents 90287c3 + 4f0510d commit d2d4184
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions source/poodinis/autowire.d
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
Expand Down

0 comments on commit d2d4184

Please sign in to comment.