about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-08-29 13:21:31 +0200
committertoonn <toonn@toonn.io>2021-08-29 13:21:31 +0200
commit6b95edf319e6ba8c9b27d011000e9552ca018230 (patch)
tree91c4480d60afdd31d4f89653aa0d15283f7f1787 /ranger
parent87d4beb5957cf55b4a19647dbd6a1c7a0fec0fd8 (diff)
parent652a971a1ebf70311b46cd41cbe6c5d4891b5ff6 (diff)
downloadranger-6b95edf319e6ba8c9b27d011000e9552ca018230.tar.gz
Merge remote-tracking branch 'pirate486743186/fix-w3m-32bit'
Diffstat (limited to 'ranger')
-rw-r--r--ranger/ext/img_display.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py
index 569d03a9..3eaa0b20 100644
--- a/ranger/ext/img_display.py
+++ b/ranger/ext/img_display.py
@@ -187,6 +187,9 @@ class W3MImageDisplayer(ImageDisplayer, FileManagerAware):
             self.initialize()
         input_gen = self._generate_w3m_input(path, start_x, start_y, width,
                                              height)
+        self.process.stdin.write(input_gen)
+        self.process.stdin.flush()
+        self.process.stdout.readline()
 
         # Mitigate the issue with the horizontal black bars when
         # selecting some images on some systems. 2 milliseconds seems
@@ -195,11 +198,10 @@ class W3MImageDisplayer(ImageDisplayer, FileManagerAware):
             from time import sleep
             sleep(self.fm.settings.w3m_delay)
 
-        self.process.stdin.write(input_gen)
-        self.process.stdin.flush()
-        self.process.stdout.readline()
+        #HACK workaround for w3mimgdisplay memory leak
         self.quit()
         self.is_initialized = False
+        #HACK
 
     def clear(self, start_x, start_y, width, height):
         if not self.is_initialized or self.process.poll() is not None: