Skip to content

Commit

Permalink
fix signal table cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
therecipe committed Aug 26, 2016
1 parent 2f211fc commit 7bcd38c
Show file tree
Hide file tree
Showing 42 changed files with 1,417 additions and 1,327 deletions.
3 changes: 3 additions & 0 deletions androidextras/androidextras.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package androidextras
//#include "androidextras_android.h"
import "C"
import (
"fmt"
"github.com/therecipe/qt"
"unsafe"
)

Expand Down Expand Up @@ -50,6 +52,7 @@ func NewQAndroidActivityResultReceiverFromPointer(ptr unsafe.Pointer) *QAndroidA

func (ptr *QAndroidActivityResultReceiver) DestroyQAndroidActivityResultReceiver() {
C.free(ptr.Pointer())
qt.DisconnectAllSignals(fmt.Sprint(ptr.Pointer()))
ptr.SetPointer(nil)
}

Expand Down
1 change: 1 addition & 0 deletions androidextras/androidextras_android.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func NewQAndroidActivityResultReceiverFromPointer(ptr unsafe.Pointer) *QAndroidA

func (ptr *QAndroidActivityResultReceiver) DestroyQAndroidActivityResultReceiver() {
C.free(ptr.Pointer())
qt.DisconnectAllSignals(fmt.Sprint(ptr.Pointer()))
ptr.SetPointer(nil)
}

Expand Down
40 changes: 20 additions & 20 deletions bluetooth/bluetooth.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func NewQBluetoothDeviceDiscoveryAgent(parent core.QObject_ITF) *QBluetoothDevic

var tmpValue = NewQBluetoothDeviceDiscoveryAgentFromPointer(C.QBluetoothDeviceDiscoveryAgent_NewQBluetoothDeviceDiscoveryAgent(core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand All @@ -349,7 +349,7 @@ func NewQBluetoothDeviceDiscoveryAgent2(deviceAdapter QBluetoothAddress_ITF, par

var tmpValue = NewQBluetoothDeviceDiscoveryAgentFromPointer(C.QBluetoothDeviceDiscoveryAgent_NewQBluetoothDeviceDiscoveryAgent2(PointerFromQBluetoothAddress(deviceAdapter), core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand Down Expand Up @@ -1745,7 +1745,7 @@ func NewQBluetoothLocalDevice(parent core.QObject_ITF) *QBluetoothLocalDevice {

var tmpValue = NewQBluetoothLocalDeviceFromPointer(C.QBluetoothLocalDevice_NewQBluetoothLocalDevice(core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand All @@ -1755,7 +1755,7 @@ func NewQBluetoothLocalDevice2(address QBluetoothAddress_ITF, parent core.QObjec

var tmpValue = NewQBluetoothLocalDeviceFromPointer(C.QBluetoothLocalDevice_NewQBluetoothLocalDevice2(PointerFromQBluetoothAddress(address), core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand Down Expand Up @@ -2328,7 +2328,7 @@ func NewQBluetoothServer(serverType QBluetoothServiceInfo__Protocol, parent core

var tmpValue = NewQBluetoothServerFromPointer(C.QBluetoothServer_NewQBluetoothServer(C.longlong(serverType), core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand Down Expand Up @@ -2496,7 +2496,7 @@ func (ptr *QBluetoothServer) NextPendingConnection() *QBluetoothSocket {
if ptr.Pointer() != nil {
var tmpValue = NewQBluetoothSocketFromPointer(C.QBluetoothServer_NextPendingConnection(ptr.Pointer()))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand Down Expand Up @@ -3153,7 +3153,7 @@ func NewQBluetoothServiceDiscoveryAgent(parent core.QObject_ITF) *QBluetoothServ

var tmpValue = NewQBluetoothServiceDiscoveryAgentFromPointer(C.QBluetoothServiceDiscoveryAgent_NewQBluetoothServiceDiscoveryAgent(core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand All @@ -3163,7 +3163,7 @@ func NewQBluetoothServiceDiscoveryAgent2(deviceAdapter QBluetoothAddress_ITF, pa

var tmpValue = NewQBluetoothServiceDiscoveryAgentFromPointer(C.QBluetoothServiceDiscoveryAgent_NewQBluetoothServiceDiscoveryAgent2(PointerFromQBluetoothAddress(deviceAdapter), core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand Down Expand Up @@ -4285,7 +4285,7 @@ func NewQBluetoothSocket(socketType QBluetoothServiceInfo__Protocol, parent core

var tmpValue = NewQBluetoothSocketFromPointer(C.QBluetoothSocket_NewQBluetoothSocket(C.longlong(socketType), core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand All @@ -4295,7 +4295,7 @@ func NewQBluetoothSocket2(parent core.QObject_ITF) *QBluetoothSocket {

var tmpValue = NewQBluetoothSocketFromPointer(C.QBluetoothSocket_NewQBluetoothSocket2(core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand Down Expand Up @@ -5618,7 +5618,7 @@ func (ptr *QBluetoothTransferManager) Put(request QBluetoothTransferRequest_ITF,
if ptr.Pointer() != nil {
var tmpValue = NewQBluetoothTransferReplyFromPointer(C.QBluetoothTransferManager_Put(ptr.Pointer(), PointerFromQBluetoothTransferRequest(request), core.PointerFromQIODevice(data)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand All @@ -5630,7 +5630,7 @@ func NewQBluetoothTransferManager(parent core.QObject_ITF) *QBluetoothTransferMa

var tmpValue = NewQBluetoothTransferManagerFromPointer(C.QBluetoothTransferManager_NewQBluetoothTransferManager(core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand Down Expand Up @@ -6206,7 +6206,7 @@ func NewQBluetoothTransferReply(parent core.QObject_ITF) *QBluetoothTransferRepl

var tmpValue = NewQBluetoothTransferReplyFromPointer(C.QBluetoothTransferReply_NewQBluetoothTransferReply(core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand Down Expand Up @@ -6441,7 +6441,7 @@ func (ptr *QBluetoothTransferReply) Manager() *QBluetoothTransferManager {
if ptr.Pointer() != nil {
var tmpValue = NewQBluetoothTransferManagerFromPointer(C.QBluetoothTransferReply_Manager(ptr.Pointer()))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand Down Expand Up @@ -8621,7 +8621,7 @@ func (ptr *QLowEnergyController) AddService(service QLowEnergyServiceData_ITF, p
if ptr.Pointer() != nil {
var tmpValue = NewQLowEnergyServiceFromPointer(C.QLowEnergyController_AddService(ptr.Pointer(), PointerFromQLowEnergyServiceData(service), core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand All @@ -8641,7 +8641,7 @@ func QLowEnergyController_CreateCentral(remoteDevice QBluetoothDeviceInfo_ITF, p

var tmpValue = NewQLowEnergyControllerFromPointer(C.QLowEnergyController_QLowEnergyController_CreateCentral(PointerFromQBluetoothDeviceInfo(remoteDevice), core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand All @@ -8651,7 +8651,7 @@ func (ptr *QLowEnergyController) CreateCentral(remoteDevice QBluetoothDeviceInfo

var tmpValue = NewQLowEnergyControllerFromPointer(C.QLowEnergyController_QLowEnergyController_CreateCentral(PointerFromQBluetoothDeviceInfo(remoteDevice), core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand All @@ -8661,7 +8661,7 @@ func QLowEnergyController_CreatePeripheral(parent core.QObject_ITF) *QLowEnergyC

var tmpValue = NewQLowEnergyControllerFromPointer(C.QLowEnergyController_QLowEnergyController_CreatePeripheral(core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand All @@ -8671,7 +8671,7 @@ func (ptr *QLowEnergyController) CreatePeripheral(parent core.QObject_ITF) *QLow

var tmpValue = NewQLowEnergyControllerFromPointer(C.QLowEnergyController_QLowEnergyController_CreatePeripheral(core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand All @@ -8682,7 +8682,7 @@ func (ptr *QLowEnergyController) CreateServiceObject(serviceUuid QBluetoothUuid_
if ptr.Pointer() != nil {
var tmpValue = NewQLowEnergyServiceFromPointer(C.QLowEnergyController_CreateServiceObject(ptr.Pointer(), PointerFromQBluetoothUuid(serviceUuid), core.PointerFromQObject(parent)))
if !qt.ExistsSignal(fmt.Sprint(tmpValue.Pointer()), "QObject::destroyed") {
tmpValue.ConnectDestroyed(func(*core.QObject) {})
tmpValue.ConnectDestroyed(func(*core.QObject) { tmpValue.SetPointer(nil) })
}
return tmpValue
}
Expand Down
Loading

0 comments on commit 7bcd38c

Please sign in to comment.