Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug:There is a memory leak in this part of the code #89

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions mapper-sdk-go/internal/mqttadapter/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ func SyncInfo(dic *di.Container, message mqtt.Message) {
if i == len(deviceInstances[instanceID].Twins) {
continue
}
// Desired value is not changed.
if deviceInstances[instanceID].Twins[i].Desired.Value == twinValue {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why delete this line?
if the desired value is not changed, we should set the value to device.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic processing in this place is not suitable for control message processing, such as controlling the camera to take pictures, one shot is fine, but two shots are not.
Currently, kubeedge does not support independent control messages, so the limitation of this place is removed first.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If removed, whether it will affect the original processing logic? Can we add some new logic to handle the situation you mentioned?

continue
}
if len(twinValue) > 30{
klog.V(4).Infof("Set %s:%s value to %s......", instanceID, twinName, twinValue[:30])
}else{
Expand Down
1 change: 1 addition & 0 deletions mappers/gige/driver/gigeclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ func (gigEClient *GigEVisionDevice) PostImage(DeviceSN string) {
go func() {
var buffer []byte
var bufferHdr = (*reflect.SliceHeader)(unsafe.Pointer(&buffer))
defer C.free_image((**C.char)(unsafe.Pointer(&imageBuffer)))
bufferHdr.Data = uintptr(unsafe.Pointer(imageBuffer))
bufferHdr.Len = size
bufferHdr.Cap = size
Expand Down