mirror of
https://github.com/XrayR-project/XrayR.git
synced 2025-06-08 13:29:54 +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
|
stm stats.Manager
|
||||||
dispatcher *mydispatcher.DefaultDispatcher
|
dispatcher *mydispatcher.DefaultDispatcher
|
||||||
startAt time.Time
|
startAt time.Time
|
||||||
dnsFeature *features.Feature
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type periodicTask struct {
|
type periodicTask struct {
|
||||||
@ -663,15 +662,7 @@ func (c *Controller) addNewDNS(newNodeInfo *api.NodeInfo) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if feature, ok := obj.(features.Feature); ok {
|
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)
|
c.server.AddFeature(feature)
|
||||||
} else {
|
|
||||||
*c.dnsFeature = feature
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user