zidsal Posted February 18, 2009 Author Share Posted February 18, 2009 ```' Closes the game client.Sub GameDestroy() ' Unloads all TCP-related things. Call TcpDestroy ' Unloads all DirectX objects. Call DestroyDirectX ' Unloads the BGM in memory (soon-to-be obsolete). Call StopBGM ' Closes the VB6 application. EndEnd Sub```I'm proberly wrong and missing something obvoius but why in hells name is eclipse using end instead of unload frmmirage e.t.c. Isn't that just going to end badly as it will leave it running in memory? Link to comment Share on other sites More sharing options...
Alster Posted February 18, 2009 Share Posted February 18, 2009 If you used unload you'd need to unload every form - just in case.This terminates the entire application and any form running in it. Link to comment Share on other sites More sharing options...
zidsal Posted February 18, 2009 Author Share Posted February 18, 2009 talked to robin about it and I was right using end is horrible as it gives very bad memory leaks. I ripped this from mirage source 4 it remains untested credit is given to mirage.Change Sub GameDestroy() to this:```' Closes the game client.Sub GameDestroy() ' Unloads all TCP-related things. Call TcpDestroy ' Unloads all DirectX objects. Call DestroyDirectX ' Unloads the BGM in memory (soon-to-be obsolete). Call StopBGM ' Closes the VB6 application. Call UnloadAllFormsEnd Sub```Add this new sub```Public Sub UnloadAllForms() Dim frm As Form For Each frm In VB.Forms Unload frm NextEnd Sub```thats one less memory leak to worry about.I reccomomend every does to fix Link to comment Share on other sites More sharing options...
vrage Posted February 18, 2009 Share Posted February 18, 2009 ```For Each frm In VB.Forms```Are you sure you can do that? (It's been a while since I used Vb) Link to comment Share on other sites More sharing options...
zidsal Posted February 18, 2009 Author Share Posted February 18, 2009 @[WTF:> Rage link=topic=38926.msg377516#msg377516 date=1234975618]> ```> For Each frm In VB.Forms> ```> Are you sure you can do that? (It's been a while since I used Vb)ripped it out directly from a mirage 4 soruce so ya I guess you can do thatEDITThough going to add before today I'd never heard of a for each statement Link to comment Share on other sites More sharing options...
vrage Posted February 18, 2009 Share Posted February 18, 2009 ok Link to comment Share on other sites More sharing options...
Guest Posted February 18, 2009 Share Posted February 18, 2009 Wow, i'm new to the Dev team and haven't caught this yet. Nice for finding this, i'm going to make this apparent to the rest of the team and look into it further. Link to comment Share on other sites More sharing options...
Drag0n Posted February 19, 2009 Share Posted February 19, 2009 Yeah, never noticed this. Nice job. Link to comment Share on other sites More sharing options...
Guest Posted February 19, 2009 Share Posted February 19, 2009 Actually after looking into this and discussing with the dev team, this isn't really an issue for more than a few reasons. End will work just fine. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now