aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan@mozilla.com>2010-05-30 22:45:31 -0400
committerEhsan Akhgari <ehsan@mozilla.com>2010-05-30 22:45:31 -0400
commit165daa6de80644be4e83a1280b779c87291eda12 (patch)
tree60826350094815c5bcc78c701379f3ab348a5e94 /lib
parent57a391918b60547c50202caf6ae95d7893871814 (diff)
downloadbugzilla-triage-165daa6de80644be4e83a1280b779c87291eda12.tar.gz
Don't store a global clipboard object, to prevent possible future leaks
Diffstat (limited to 'lib')
-rw-r--r--lib/clipboard.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/clipboard.js b/lib/clipboard.js
index 66bce69..bf77515 100644
--- a/lib/clipboard.js
+++ b/lib/clipboard.js
@@ -34,9 +34,6 @@
*
* ***** END LICENSE BLOCK ***** */
-var clipboard = Cc["@mozilla.org/widget/clipboard;1"].
- getService(Ci.nsIClipboard);
-
var setMethod = exports.setMethod = function setMethod(content, flavor) {
if (typeof(flavor) == "undefined") {
flavor = "plain";
@@ -47,6 +44,9 @@ var setMethod = exports.setMethod = function setMethod(content, flavor) {
}
flavor = flavor == "plain" ? "text/unicode", "text/html";
+ var clipboard = Cc["@mozilla.org/widget/clipboard;1"].
+ getService(Ci.nsIClipboard);
+
var str = Cc["@mozilla.org/supports-string;1"].
createInstance(Ci.nsISupportsString);
str.data = content;