Skip to content

Commit 3a5ec79

Browse files
committed
Strongly prevent saving objects created by old module classloader
1 parent 1cdde90 commit 3a5ec79

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

api/src/main/java/io/github/libxposed/api/XposedModuleInterface.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,14 @@ interface HotReloadingParam {
129129
Bundle getExtras();
130130

131131
/**
132-
* Sets the data to be passed to the new code after hot reloading. This can be retrieved in {@link #onHotReloaded(HotReloadedParam)}.
133-
* Objects created under the system, system server, or app classloaders can be used. Be careful
134-
* that you should <b>NEVER</b> put an object that is created under the old module classloader, or
135-
* the old code may remain strongly reachable after hot reloading. If needed, you should use
132+
* Sets the data to be passed to the new code after hot reloading. This can be retrieved in
133+
* {@link #onHotReloaded(HotReloadedParam)}. Objects created under the system, system server,
134+
* or app classloaders can be used. Objects created under the old module classloader are rejected
135+
* because they would keep the old code strongly reachable after hot reloading. If needed, use
136136
* {@link Bundle} to serialize the data.
137137
*
138138
* @param outState The data to be passed to the new code after hot reloading
139+
* @throws IllegalArgumentException if {@code outState} was created under the old module classloader
139140
*/
140141
void setSavedInstanceState(@Nullable Object outState);
141142
}

0 commit comments

Comments
 (0)