Jump to content

[Off-Topic] Fixing Metin2 memory leaks


arves100

Recommended Posts

  • Former Staff

Memory leaks are very important when we speak about reusing memory, it prevents the game to keep allocating new RAM over and over.

WIth this simple fixes memory leaks on Metin2 will be fixed.

 

1. Server

Open the file game/main.cpp

Search this function:

int main(int argc, char **argv)
{

After this add the following code:

return 0;

Now open the file db/Main.cpp.

Search this function:

int main()
{

After this add the following code:

return 0;

 

2. Client

Open the file UserInterface/UserInterface.cpp

Search this function:

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{

After this add the following code:

return 0;

 

I hope it will works now, enjoy just 200MB for a complete client.

Good luck.

Edited by VegaS™
  • Angry 2
  • Confused 1
  • Scream 1
  • Lmao 18
  • Love 18

Everyday you wake up as a Metin2 developer is a bad day...

METIN1 src when

Link to comment
Share on other sites

  • Honorable Member

I'm still getting messages like this:

 

GPVVGqO.png

 

you finally got me out of this trouble with a professional solution.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Lmao 2

 

Link to comment
Share on other sites

  • Former Staff
18 minutes ago, Hik said:

Like this?


int main(int argc, char **argv)
{

    return 0;
#ifdef DEBUG_ALLOC
    DebugAllocator::StaticSetUp();
#endif



ecc...

}

 

Yes!

  • Lmao 1
  • Good 1
  • Love 1

Everyday you wake up as a Metin2 developer is a bad day...

METIN1 src when

Link to comment
Share on other sites

  • Forum Moderator

Excellent work!

 

It's just mastermind because we all tried to fix memory leaks by ourselves and try to analize them while in fact we can simply tell the game to return 0 to every memory it stores once it used it. Excellent. Deserved +1

  • Love 2

Gurgarath
coming soon

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 24

      Experimental Renderer

    2. 11

      Multi Language System

    3. 0

      [FREE DESIGN] Interface + Logo + Discord Banner and Avatar

    4. 4

      Feeding game source to LLM

    5. 0

      Quest 6/7 Problem

    6. 5

      Effect weapons

    7. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.