XTLS / libXray

MIT License
64 stars 57 forks source link

Fix memory leak issues when repeatedly running the server. #20

Closed musqdp closed 6 months ago

yuhan6665 commented 6 months ago

I don't think your code does anything. Reopen if can justify

musqdp commented 6 months ago

This example shows how to work global variable "a" without my changes http://tpcg.io/_M27OY9

musqdp commented 6 months ago

@yuhan6665 I dont know how to reopen it

yuhan6665 commented 6 months ago

don't get what you are saying

musqdp commented 6 months ago

I assume that in the RunXray method, you tried to override the global variable coreServer, but by using the := symbol, you only create a variable in the local scope of the function that then starts the server. If we run several RunXray configurations, we will find that the local variables consume resources when starting the server, and there is no way to stop the server since the global variable was not changed.

yuhan6665 commented 6 months ago

@musqdp sorry I didn't see your message in time. You were right. Should be good now