Browse Source

Load proxied listener calls in the correct class loader

This stopped plugins from being able to use awesome listener calls

Change-Id: I31204638628067954611bbd07525ed31bf92baa7
Reviewed-on: http://gerrit.dmdirc.com/2146
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.7rc1
Greg Holmes 13 years ago
parent
commit
2fda4cc842
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/com/dmdirc/util/ListenerList.java

+ 2
- 1
src/com/dmdirc/util/ListenerList.java View File

@@ -138,8 +138,9 @@ public class ListenerList {
138 138
      * @param listenerType The type of listener to be called
139 139
      * @return A proxy instance that can be used to call methods
140 140
      */
141
+    @SuppressWarnings("unchecked")
141 142
     public <T> T getCallable(final Class<T> listenerType) {
142
-        return (T) Proxy.newProxyInstance(getClass().getClassLoader(),
143
+        return (T) Proxy.newProxyInstance(listenerType.getClassLoader(),
143 144
                 new Class[] { listenerType }, new CallHandler<T>(listenerType));
144 145
     }
145 146
 

Loading…
Cancel
Save