X Tutup
Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,22 @@ public void addWindow(View view, String name) {
* @see #addWindow(View, String)
*/
public void removeWindow(View view) {
View rootView;
mWindowsLock.writeLock().lock();
try {
mWindows.remove(view.getRootView());
rootView = view.getRootView();
mWindows.remove(rootView);
} finally {
mWindowsLock.writeLock().unlock();
}
mFocusLock.writeLock().lock();
try {
if (mFocusedWindow == rootView) {
mFocusedWindow = null;
}
} finally {
mFocusLock.writeLock().unlock();
}
fireWindowsChangedEvent();
}

Expand Down Expand Up @@ -471,10 +481,10 @@ private interface WindowListener {
void focusChanged();
}

private static class UncloseableOuputStream extends OutputStream {
private static class UncloseableOutputStream extends OutputStream {
private final OutputStream mStream;

UncloseableOuputStream(OutputStream stream) {
UncloseableOutputStream(OutputStream stream) {
mStream = stream;
}

Expand Down Expand Up @@ -667,7 +677,7 @@ private boolean windowCommand(Socket client, String command, String parameters)
// call stuff
final Method dispatch = ViewDebug.class.getDeclaredMethod("dispatchCommand", View.class, String.class, String.class, OutputStream.class);
dispatch.setAccessible(true);
dispatch.invoke(null, window, command, parameters, new UncloseableOuputStream(client.getOutputStream()));
dispatch.invoke(null, window, command, parameters, new UncloseableOutputStream(client.getOutputStream()));

if (!client.isOutputShutdown()) {
out = new BufferedWriter(new OutputStreamWriter(client.getOutputStream()));
Expand Down
X Tutup