mirror of
https://github.com/XrayR-project/XrayR.git
synced 2025-06-07 21:09:53 +00:00
fix: dns memory leak
It can be properly working after xray-core accept the patch
This commit is contained in:
parent
21e0ebc428
commit
6477ef6c44
@ -48,7 +48,6 @@ type Controller struct {
|
||||
stm stats.Manager
|
||||
dispatcher *mydispatcher.DefaultDispatcher
|
||||
startAt time.Time
|
||||
dnsFeature *features.Feature
|
||||
}
|
||||
|
||||
type periodicTask struct {
|
||||
@ -663,15 +662,7 @@ func (c *Controller) addNewDNS(newNodeInfo *api.NodeInfo) error {
|
||||
return err
|
||||
}
|
||||
if feature, ok := obj.(features.Feature); ok {
|
||||
// todo fix memory leak
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
if c.dnsFeature == nil {
|
||||
c.dnsFeature = &feature
|
||||
c.server.AddFeature(feature)
|
||||
} else {
|
||||
*c.dnsFeature = feature
|
||||
}
|
||||
c.server.AddFeature(feature)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user