mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-17 05:08:37 -04:00
Fix numerous memory leaks and uses of uninitialized variables
These were discovered when running under teh valgrind MemCheck tool. I have also checked in a suppressions file (wsjtx-valgrind.linux.supp) suitable for use on Linux when running the valgrind MemCheck tool. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6755 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
+13
-2
@@ -61,7 +61,7 @@ namespace
|
||||
|
||||
// callback function that receives transceiver capabilities from the
|
||||
// hamlib libraries
|
||||
int rigCallback (rig_caps const * caps, void * callback_data)
|
||||
int register_callback (rig_caps const * caps, void * callback_data)
|
||||
{
|
||||
TransceiverFactory::Transceivers * rigs = reinterpret_cast<TransceiverFactory::Transceivers *> (callback_data);
|
||||
|
||||
@@ -106,6 +106,12 @@ namespace
|
||||
return 1; // keep them coming
|
||||
}
|
||||
|
||||
int unregister_callback (rig_caps const * caps, void *)
|
||||
{
|
||||
rig_unregister (caps->rig_model);
|
||||
return 1; // keep them coming
|
||||
}
|
||||
|
||||
// int frequency_change_callback (RIG * /* rig */, vfo_t vfo, freq_t f, rig_ptr_t arg)
|
||||
// {
|
||||
// (void)vfo; // unused in release build
|
||||
@@ -158,7 +164,12 @@ void HamlibTransceiver::register_transceivers (TransceiverFactory::Transceivers
|
||||
#endif
|
||||
|
||||
rig_load_all_backends ();
|
||||
rig_list_foreach (rigCallback, registry);
|
||||
rig_list_foreach (register_callback, registry);
|
||||
}
|
||||
|
||||
void HamlibTransceiver::unregister_transceivers ()
|
||||
{
|
||||
rig_list_foreach (unregister_callback, nullptr);
|
||||
}
|
||||
|
||||
void HamlibTransceiver::RIGDeleter::cleanup (RIG * rig)
|
||||
|
||||
Reference in New Issue
Block a user