[Gpredict-svn] SF.net SVN: gpredict:[622] trunk
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <cs...@us...> - 2010-06-18 10:08:54
|
Revision: 622
http://gpredict.svn.sourceforge.net/gpredict/?rev=622&view=rev
Author: csete
Date: 2010-06-18 10:08:48 +0000 (Fri, 18 Jun 2010)
Log Message:
-----------
Applied patch 3009727: Free satellite hash references.
Modified Paths:
--------------
trunk/ChangeLog
trunk/NEWS
trunk/src/gtk-sat-data.c
trunk/src/gtk-sat-data.h
trunk/src/gtk-sat-module.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-06-18 09:49:11 UTC (rev 621)
+++ trunk/ChangeLog 2010-06-18 10:08:48 UTC (rev 622)
@@ -3,6 +3,12 @@
* src/main.c:
Applied patch 3009725: Delete Explicit Call to gtk_set_locale.
+ * src/gtk-sat-data.[ch]:
+ Added function to free satellite name, nickname and website (patch 3009727).
+
+ * src/gtk-sat-module.c:
+ Use new gtk_sat_data_free_sat() function (patch 3009727).
+
2010-05-23 Alexandru Csete <oz9aec at gmail.com>
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2010-06-18 09:49:11 UTC (rev 621)
+++ trunk/NEWS 2010-06-18 10:08:48 UTC (rev 622)
@@ -35,6 +35,7 @@
- Applied patch 3002348: Option context never freed (Thanks to Charles Suprin AA1VS).
- Applied patch 3005548: Cut and Paste Error In print_pass.h (Thanks to Charles Suprin AA1VS).
- Applied patch 3009725: Delete Explicit Call to gtk_set_locale (Thanks to Charles Suprin AA1VS).
+- Applied patch 3009727: Free satellite hash references (Thanks to Charles Suprin AA1VS).
- Slightly improved UI for the single-satellite view.
- Command line options for cleaning user's TLE and transponder data, see --help for list.
- Satellite Map: Added shadow to satellite marker and label to enhance visual appearance
Modified: trunk/src/gtk-sat-data.c
===================================================================
--- trunk/src/gtk-sat-data.c 2010-06-18 09:49:11 UTC (rev 621)
+++ trunk/src/gtk-sat-data.c 2010-06-18 10:08:48 UTC (rev 622)
@@ -301,3 +301,31 @@
gtk_sat_data_init_sat (dest, qth);
}
+
+
+/** \brief Free satellite data
+ * \param sat Pointer to the satellite data to free
+ *
+ * This function frees the memory that has been dyunamically allocated
+ * when creating a new satellite object.
+ */
+void gtk_sat_data_free_sat(sat_t *sat)
+{
+
+ if (sat){
+ if (sat->name){
+ g_free(sat->name);
+ sat->name=NULL;
+ }
+ if (sat->nickname){
+ g_free(sat->nickname);
+ sat->nickname=NULL;
+ }
+ if (sat->website){
+ g_free(sat->website);
+ sat->website=NULL;
+ }
+
+ g_free(sat);
+ }
+}
Modified: trunk/src/gtk-sat-data.h
===================================================================
--- trunk/src/gtk-sat-data.h 2010-06-18 09:49:11 UTC (rev 621)
+++ trunk/src/gtk-sat-data.h 2010-06-18 10:08:48 UTC (rev 622)
@@ -36,5 +36,5 @@
gint gtk_sat_data_read_sat (gint catnum, sat_t *sat);
void gtk_sat_data_init_sat (sat_t *sat, qth_t *qth);
void gtk_sat_data_copy_sat (const sat_t *source, sat_t *dest, qth_t *qth);
-
+void gtk_sat_data_free_sat (sat_t *sat);
#endif
Modified: trunk/src/gtk-sat-module.c
===================================================================
--- trunk/src/gtk-sat-module.c 2010-06-18 09:49:11 UTC (rev 621)
+++ trunk/src/gtk-sat-module.c 2010-06-18 10:08:48 UTC (rev 622)
@@ -80,6 +80,7 @@
const gchar *cfgfile);
static void gtk_sat_module_load_sats (GtkSatModule *module);
+static void gtk_sat_module_free_sat (gpointer sat);
static gboolean gtk_sat_module_timeout_cb (gpointer module);
static void gtk_sat_module_update_sat (gpointer key,
gpointer val,
@@ -165,7 +166,7 @@
module->satellites = g_hash_table_new_full (g_int_hash,
g_int_equal,
g_free,
- g_free);
+ gtk_sat_module_free_sat);
module->rotctrlwin = NULL;
module->rotctrl = NULL;
@@ -703,6 +704,15 @@
}
+/** \brief Free satellite data
+ *
+ * This function is called automatically for each satellite when
+ * the hash table is destroyed.
+ */
+static void gtk_sat_module_free_sat (gpointer sat)
+{
+ gtk_sat_data_free_sat (SAT(sat));
+}
/** \brief Module timeout callback.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|