Skip to content

Commit 949dabe

Browse files
committed
PDFBOX-5660: refactor, avoid leaking this in constructor
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1934052 13f79535-47bb-0310-9956-ffa450edef68
1 parent 825c7d8 commit 949dabe

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,7 @@ else if (COSName.IMAGE.equals((stream).getCOSName(COSName.SUBTYPE)))
11371137
}
11381138
}
11391139
StreamPane streamPane = new StreamPane(stream, isContentStream, isThumb, resourcesDic);
1140+
streamPane.init();
11401141
replaceRightComponent(streamPane.getPanel());
11411142
}
11421143

debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,16 @@ public StreamPane(COSStream cosStream, boolean isContentStream, boolean isThumb,
143143
niceView = null;
144144
}
145145

146+
tabbedPane = new JTabbedPane();
147+
}
148+
149+
/**
150+
* Initialization, to be called immediately after construction.
151+
*
152+
* @throws IOException if there is an I/O error during internal data transfer.
153+
*/
154+
public void init() throws IOException
155+
{
146156
if (stream.isImage())
147157
{
148158
panel.add(createHeaderPanel(stream.getFilterList(), Stream.IMAGE, this));
@@ -154,7 +164,6 @@ public StreamPane(COSStream cosStream, boolean isContentStream, boolean isThumb,
154164
requestStreamText(Stream.DECODED);
155165
}
156166

157-
tabbedPane = new JTabbedPane();
158167
if (stream.isImage())
159168
{
160169
tabbedPane.add("Image view", rawView.getStreamPanel());

0 commit comments

Comments
 (0)