I've observed that after deleting somewhere around 800-1000 images from Image Viewer (1 by 1), DOpus starts mispainting the main window. I have to shutdown and restart dopus to correct it. This happens if I delete that many images in a single session regardless if I exit the viewer, do something else in dopus and resume the delete activity.
The images are mostly around 400KB in size with some rare ones being upto 2MB.
I don't have a screenshot but will capture one when it happens again. The GPU drivers are updated. This has been having since around 6 months so unlikely to be due to a bad update. Its not daily that I would up deleting these many images, so the occurence is quite rare.
I had another incident but this time it was very tiny repainting issue. The filename, ext and size is appearing under the toolbar. Some rectangles are appearing in the tree and number 2 is appearing between tree and lister (I guess thats from the date)
Something in the process is probably leaking GDI handles. Once they run out things like that can happen.
The problem is working out what’s leaking them, which could be Opus itself or could be a third party shell extension or viewer or similar.
Task Manager’s Details tab lets you turn on a GDI Handles column. Watching the value of that as you do things can help locate the cause. It you can find an action which makes it go up and never go down, such that repeating it several times makes the count keep going up, that’s probably the trigger. From that it should be easier to work out which components are involved and narrow it down to a root cause.
Wonderful, I noticed that the GDI objects count remains stable when I simply navigate images but was increasing (adds 15 and subtracts 2) on every delete action. I have a custom script running on delete items that handles a counter. As such the decrement on the counter isn't problematic, but I also invoke a custom script that persists the variable. Disabling the persist code, stabilizes the GDI objects.
Though this persists/updates the values, but continues to keep the GDIHandles open. I tried calling the script with just return and it also keeps the handles open.
So it appears that when the JScript environment is spawned from, something isn't released. I tried executing a script from outside the viewer and from the viewer. Handles were released from main lister invocations but not from the image viewers invocation.
On other note, I need to invoke DOpus.Vars(name).persist = true; so that the updates can stick and those don't without the PersistVariables script or the delete command button from lxp
I'd like to try this here but I'm confused by your PersistVariables script; it seems like you're calling it as if it's a script command, but the script you posted for it has an OnClick method which is only used in a script stored in a button.
I've it exactly that way. It may be that script doesn't even do anything as the OnClick method won't be executing. Even if I don't have any statements in the OnClick method, the variable changes are reflected.
Prior to evaluator availability, I had been doing the variable updates via similar script inside the OnClick method. Infact I have all my scripts using the OnClick method as an entry point and being triggered as script commands.
Script functions are called via their OnClick event - although implementing this method is optional, as the entire script is executed when a script button or hotkey is run. The advantage of implementing OnClick is the ClickData object passed to the method which can provide useful information about the command's environment.
At this point, I think there are two issues
The variable set via evalaways isn't reflected in the outside environment even when its a global variable unless the JScript environment is initiated be it via the PersistVariables script or the below command from lxp.
Show VIEWERCMD=delete
=if(InStr(source, "D:\Home\Pictures") >= 0) {$glob:img_deleted+=1; $glob:imgs-=1};
When a JScript is launched from inside Image Viewer, there is a leak
FWIW, I haven’t experienced issue .2 here. I use several scripts in the Viewer and have never seen or noticed the behavior you’re describing. The GDI handles also remain at normal levels.
For .1 try:
Show VIEWERCMD=delete
=if(InStr(source, "D:\Home\Pictures") >= 0) {$glob:img_deleted=IsSet($glob:img_deleted)?$glob:img_deleted+1:1;$glob:imgs=IsSet($glob:imgs)?$glob:imgs-1:-1;}
I mostly use the OnViewer event instead, but not for counting files. I think the best way to help would be for you to share the script you’re using and/or explain what you’re trying to achieve with those counters.