just to make sure that i won't miss anything when i'll finish up the cabinet branch: could you please check what is different with your own VPM version (all changes you have) and send me a PM with a patch?
Thanks!
Posted 25 February 2014 - 10:16 AM
I would like to see this issue resolved to be honest as it was causing some (infrequent) crashes on my system.
Despite the residual issues that remain, this beta build is now my main version, so Great work and please keep it up!
Thanks
Ok, I found and fixed some more longstanding memory leaks in the image loading code, so it should be much better now. Thanks for reporting that.
I still have my doubts if the VPM object gets released in the table script, I hope someone experienced with scripting can chime in.
Posted 25 February 2014 - 12:41 PM
I would like to see this issue resolved to be honest as it was causing some (infrequent) crashes on my system.
Despite the residual issues that remain, this beta build is now my main version, so Great work and please keep it up!
Thanks
Ok, I found and fixed some more longstanding memory leaks in the image loading code, so it should be much better now. Thanks for reporting that.
I still have my doubts if the VPM object gets released in the table script, I hope someone experienced with scripting can chime in.
Can you explain more about the VPM object leak?
Posted 25 February 2014 - 12:59 PM
I would like to see this issue resolved to be honest as it was causing some (infrequent) crashes on my system.
Despite the residual issues that remain, this beta build is now my main version, so Great work and please keep it up!
Thanks
Ok, I found and fixed some more longstanding memory leaks in the image loading code, so it should be much better now. Thanks for reporting that.
I still have my doubts if the VPM object gets released in the table script, I hope someone experienced with scripting can chime in.
Can you explain more about the VPM object leak?
When you start a table which uses VPM, there is a line in the script which creates the VPM controller object. This internally uses the COM system, it loads up the vpinmame.dll and asks it to create the controller. The controller is then used throughout gameplay to control the table elements via the ROM.
What I wonder is, when the table player (but not VP itself) is stopped, is this controller object released again? Does the script need to do this manually or does the scripting engine take care that it is released? Or is it never released, just staying in limbo and eating up resources until you quit the VP process?
Posted 25 February 2014 - 01:08 PM
well, try to update your vpinmame.dll, rename, delete after you quit a table but not exited vp, you won't be able to do it if i remember.
It is the same for DOF, and probably B2S.Server.
but when using a frontend, it closes vp totally

Posted 25 February 2014 - 01:37 PM
"it will all be ok in the end, if it's not ok, it's not the end"
Monster Bash VP10 WIP https://dl.dropboxus... (vpx)WIP15.vpx
Posted 25 February 2014 - 01:37 PM
"it will all be ok in the end, if it's not ok, it's not the end"
Monster Bash VP10 WIP https://dl.dropboxus... (vpx)WIP15.vpx
Posted 25 February 2014 - 01:39 PM
Yup, VPM always just stays there. And as it never was a big issue in practice, so far nobody ever looked into this in detail.
But would be cool if it would be fixed, as currently the "official" recommendation is that basically after each table run that uses VPM, one should restart VP. :/
Posted 25 February 2014 - 01:51 PM

Posted 25 February 2014 - 02:10 PM
Edited by unclewilly, 25 February 2014 - 02:12 PM.
"it will all be ok in the end, if it's not ok, it's not the end"
Monster Bash VP10 WIP https://dl.dropboxus... (vpx)WIP15.vpx
Posted 25 February 2014 - 02:28 PM
Hmm shouldn't "set controller=nothing" on the table_exit function do the trick? The garbage collection should kick in and frees the resource then, but only if the reference count is zero. So if you have multiple variables pointing to VPM or you assigned VPM also to another variable then you should set this variable to nothing too.
Edited by fuzzel, 25 February 2014 - 02:28 PM.
Posted 25 February 2014 - 02:33 PM
"it will all be ok in the end, if it's not ok, it's not the end"
Monster Bash VP10 WIP https://dl.dropboxus... (vpx)WIP15.vpx
Posted 25 February 2014 - 02:38 PM
You can define it in you script like:
sub [tablename]_exit()
controller.stop()
set controller = nothing
end sub
After the player quits try to move your vpinmame.dll to another folder. If another process uses the dll you get an access violation error message
I haven't tested it myself but normaly this is the way how you can free resources in vbs scripts.
Posted 25 February 2014 - 02:48 PM
I wonder though, isn't the scripting engine initialized and destroyed for every player instance anyway? This should mean that the VB environment is destroyed and all variables automatically go "out of scope" automatically, and the VPM controller should be released. This is what this here says at least:
http://stackoverflow...t-up-by-setting
Posted 25 February 2014 - 03:01 PM
Yes the script engine is destroyed but you load a separate resource not from the actual script engine but from the VBA/COM server which is an own process which isn't destroyed at the end of the player
So my guess is that the server holds the resource even if the player is terminated. Perhaps you can force to unload the dll by using the nothing-trick.
Posted 25 February 2014 - 03:15 PM
VPinMAME is implemented as an in-process server (DLL), so there is no separate process. I just had a look through the code: PinTable::StopPlaying() calls CodeViewer::EndSession(), which in turn calls CleanUpScriptEngine(), which releases the IActiveScript object and then reinitializes it. So in theory everything should get cleaned up, unless there is some messup with the reference counting...
Posted 25 February 2014 - 04:25 PM
You can define it in you script like:
sub [tablename]_exit()
controller.stop()
set controller = nothing
end sub
After the player quits try to move your vpinmame.dll to another folder. If another process uses the dll you get an access violation error message
I haven't tested it myself but normaly this is the way how you can free resources in vbs scripts.
I just tested this.
It doesn't seem VP keeps a file handle open on vpinmame.dll, I can use the windows explorer to rename or move the dll while the table is running.
VPinMAME.Controller: If I rename the file while vpinmame is active and stop the emulation I get an error message when I start the emulation again.
B2S.Server: If I rename the file while vpinmame is active and stop the emulation I don't get an error message when I start the emulation again. The table runs with vpinmame active.
set controller = nothing doesn't seem to make a difference in both cases.
Edited by Sir Cheddar, 25 February 2014 - 04:25 PM.