aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-05-11 19:33:51 +0800
committerChris Toshok <toshok@src.gnome.org>2001-05-11 19:33:51 +0800
commite6a4fcd9a248183751afd1bca0af676e4bc36089 (patch)
treedf57728ace788aebf83decd0f54fe49a3e434af1
parent7da5a58462520d93415418c258acf0cb73972977 (diff)
downloadgsoc2013-evolution-e6a4fcd9a248183751afd1bca0af676e4bc36089.tar.gz
gsoc2013-evolution-e6a4fcd9a248183751afd1bca0af676e4bc36089.tar.zst
gsoc2013-evolution-e6a4fcd9a248183751afd1bca0af676e4bc36089.zip
don't leak the ECard or ECardSimple.
2001-05-11 Chris Toshok <toshok@ximian.com> * contact-editor/e-contact-editor.c (enable_writable_fields): don't leak the ECard or ECardSimple. svn path=/trunk/; revision=9757
-rw-r--r--addressbook/ChangeLog5
-rw-r--r--addressbook/contact-editor/e-contact-editor.c22
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c22
3 files changed, 31 insertions, 18 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 10e0616c9c..3a70eb7862 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,8 @@
+2001-05-11 Chris Toshok <toshok@ximian.com>
+
+ * contact-editor/e-contact-editor.c (enable_writable_fields):
+ don't leak the ECard or ECardSimple.
+
2001-05-08 Iain Holmes <iain@ximian.com>
* backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.oaf.in:
diff --git a/addressbook/contact-editor/e-contact-editor.c b/addressbook/contact-editor/e-contact-editor.c
index 8c9b7519a3..f4ebc9c68d 100644
--- a/addressbook/contact-editor/e-contact-editor.c
+++ b/addressbook/contact-editor/e-contact-editor.c
@@ -1774,13 +1774,15 @@ enable_writable_fields(EContactEditor *editor)
EIterator *iter;
GHashTable *dropdown_hash, *supported_hash;
int i;
- ECardSimple *card;
+ ECardSimple *simple;
+ ECard *card;
char *widget_name;
if (!fields)
return;
- card = e_card_simple_new (e_card_new (""));
+ card = e_card_new ("");
+ simple = e_card_simple_new (card);
dropdown_hash = g_hash_table_new (g_str_hash, g_str_equal);
supported_hash = g_hash_table_new (g_str_hash, g_str_equal);
@@ -1789,17 +1791,17 @@ enable_writable_fields(EContactEditor *editor)
e_contact_editor_build_phone_ui (editor);
for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i ++)
g_hash_table_insert (dropdown_hash,
- (char*)e_card_simple_get_ecard_field(card, e_card_simple_map_phone_to_field (i)),
+ (char*)e_card_simple_get_ecard_field(simple, e_card_simple_map_phone_to_field (i)),
editor->phone_info[i].widget);
e_contact_editor_build_email_ui (editor);
for (i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i ++)
g_hash_table_insert (dropdown_hash,
- (char*)e_card_simple_get_ecard_field(card, e_card_simple_map_email_to_field (i)),
+ (char*)e_card_simple_get_ecard_field(simple, e_card_simple_map_email_to_field (i)),
editor->email_info[i].widget);
e_contact_editor_build_address_ui (editor);
for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++)
g_hash_table_insert (dropdown_hash,
- (char*)e_card_simple_get_ecard_field(card, e_card_simple_map_address_to_field (i)),
+ (char*)e_card_simple_get_ecard_field(simple, e_card_simple_map_address_to_field (i)),
editor->address_info[i].widget);
/* then disable them all */
@@ -1843,18 +1845,18 @@ enable_writable_fields(EContactEditor *editor)
disabled label next to a drop down when the item in
the menu (the one reflected in the label) is
enabled. */
- if (!strcmp (field, e_card_simple_get_ecard_field (card, e_card_simple_map_email_to_field(editor->email_choice)))) {
+ if (!strcmp (field, e_card_simple_get_ecard_field (simple, e_card_simple_map_email_to_field(editor->email_choice)))) {
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "label-email1"), TRUE);
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "entry-email1"), !editor->is_read_only);
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "checkbutton-htmlmail"), TRUE);
}
- else if (!strcmp (field, e_card_simple_get_ecard_field (card, e_card_simple_map_address_to_field(editor->address_choice)))) {
+ else if (!strcmp (field, e_card_simple_get_ecard_field (simple, e_card_simple_map_address_to_field(editor->address_choice)))) {
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "label-address"), TRUE);
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "button-fulladdr"), !editor->is_read_only);
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "text-address"), !editor->is_read_only);
}
else for (i = 0; i < 4; i ++) {
- if (!strcmp (field, e_card_simple_get_ecard_field (card, e_card_simple_map_phone_to_field(editor->phone_choice[i])))) {
+ if (!strcmp (field, e_card_simple_get_ecard_field (simple, e_card_simple_map_phone_to_field(editor->phone_choice[i])))) {
widget_name = g_strdup_printf ("label-phone%d", i+1);
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, widget_name), TRUE);
g_free (widget_name);
@@ -1869,7 +1871,7 @@ enable_writable_fields(EContactEditor *editor)
for (i = 0; i < num_widget_field_mappings; i ++) {
gboolean enabled = g_hash_table_lookup (supported_hash,
- e_card_simple_get_ecard_field (card,
+ e_card_simple_get_ecard_field (simple,
widget_field_mappings[i].field_id)) != NULL;
gtk_widget_set_sensitive (glade_xml_get_widget(editor->gui,
widget_field_mappings[i].widget_name), enabled);
@@ -1877,6 +1879,8 @@ enable_writable_fields(EContactEditor *editor)
g_hash_table_destroy (dropdown_hash);
g_hash_table_destroy (supported_hash);
+ gtk_object_unref (GTK_OBJECT(simple));
+ gtk_object_unref (GTK_OBJECT(card));
}
static void
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 8c9b7519a3..f4ebc9c68d 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -1774,13 +1774,15 @@ enable_writable_fields(EContactEditor *editor)
EIterator *iter;
GHashTable *dropdown_hash, *supported_hash;
int i;
- ECardSimple *card;
+ ECardSimple *simple;
+ ECard *card;
char *widget_name;
if (!fields)
return;
- card = e_card_simple_new (e_card_new (""));
+ card = e_card_new ("");
+ simple = e_card_simple_new (card);
dropdown_hash = g_hash_table_new (g_str_hash, g_str_equal);
supported_hash = g_hash_table_new (g_str_hash, g_str_equal);
@@ -1789,17 +1791,17 @@ enable_writable_fields(EContactEditor *editor)
e_contact_editor_build_phone_ui (editor);
for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i ++)
g_hash_table_insert (dropdown_hash,
- (char*)e_card_simple_get_ecard_field(card, e_card_simple_map_phone_to_field (i)),
+ (char*)e_card_simple_get_ecard_field(simple, e_card_simple_map_phone_to_field (i)),
editor->phone_info[i].widget);
e_contact_editor_build_email_ui (editor);
for (i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i ++)
g_hash_table_insert (dropdown_hash,
- (char*)e_card_simple_get_ecard_field(card, e_card_simple_map_email_to_field (i)),
+ (char*)e_card_simple_get_ecard_field(simple, e_card_simple_map_email_to_field (i)),
editor->email_info[i].widget);
e_contact_editor_build_address_ui (editor);
for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++)
g_hash_table_insert (dropdown_hash,
- (char*)e_card_simple_get_ecard_field(card, e_card_simple_map_address_to_field (i)),
+ (char*)e_card_simple_get_ecard_field(simple, e_card_simple_map_address_to_field (i)),
editor->address_info[i].widget);
/* then disable them all */
@@ -1843,18 +1845,18 @@ enable_writable_fields(EContactEditor *editor)
disabled label next to a drop down when the item in
the menu (the one reflected in the label) is
enabled. */
- if (!strcmp (field, e_card_simple_get_ecard_field (card, e_card_simple_map_email_to_field(editor->email_choice)))) {
+ if (!strcmp (field, e_card_simple_get_ecard_field (simple, e_card_simple_map_email_to_field(editor->email_choice)))) {
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "label-email1"), TRUE);
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "entry-email1"), !editor->is_read_only);
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "checkbutton-htmlmail"), TRUE);
}
- else if (!strcmp (field, e_card_simple_get_ecard_field (card, e_card_simple_map_address_to_field(editor->address_choice)))) {
+ else if (!strcmp (field, e_card_simple_get_ecard_field (simple, e_card_simple_map_address_to_field(editor->address_choice)))) {
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "label-address"), TRUE);
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "button-fulladdr"), !editor->is_read_only);
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "text-address"), !editor->is_read_only);
}
else for (i = 0; i < 4; i ++) {
- if (!strcmp (field, e_card_simple_get_ecard_field (card, e_card_simple_map_phone_to_field(editor->phone_choice[i])))) {
+ if (!strcmp (field, e_card_simple_get_ecard_field (simple, e_card_simple_map_phone_to_field(editor->phone_choice[i])))) {
widget_name = g_strdup_printf ("label-phone%d", i+1);
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, widget_name), TRUE);
g_free (widget_name);
@@ -1869,7 +1871,7 @@ enable_writable_fields(EContactEditor *editor)
for (i = 0; i < num_widget_field_mappings; i ++) {
gboolean enabled = g_hash_table_lookup (supported_hash,
- e_card_simple_get_ecard_field (card,
+ e_card_simple_get_ecard_field (simple,
widget_field_mappings[i].field_id)) != NULL;
gtk_widget_set_sensitive (glade_xml_get_widget(editor->gui,
widget_field_mappings[i].widget_name), enabled);
@@ -1877,6 +1879,8 @@ enable_writable_fields(EContactEditor *editor)
g_hash_table_destroy (dropdown_hash);
g_hash_table_destroy (supported_hash);
+ gtk_object_unref (GTK_OBJECT(simple));
+ gtk_object_unref (GTK_OBJECT(card));
}
static void
t.cgi/freebsd-ports-gnome/commit/lang/fpc?h=gnome-3.24&id=bf97e95ebb65fe7407d8bc40117f54ed8adde671'>- Add ${LOCALBASE}/lib/qt4 path to fpc.cfg config fileacm2012-05-081-1/+2 * - Use USE_XORG instead of USE_XLIBacm2012-04-191-1/+1 * - Update to 2.6.0acm2012-04-196-170/+185 * - Chase unixODBC shlib bumpmiwi2012-02-061-1/+1 * - change required APACHE version from 13+ to 20+ohauer2012-01-021-6/+0 * - update fftw3* to 3.3 [1], and adjust dependent portsbf2011-10-171-1/+1 * - Track dependencies after databases/gdbm updategabor2011-09-121-1/+1 * - Chase x11-toolkits/xforms shlib version bumpgahr2011-09-071-1/+1 * - set EXPIRATION_DATE to "one week after FreeBSD 9.0-RELEASE-p0"ohauer2011-08-271-4/+4 * - Update to 2.4.4acm2011-06-234-18/+28 * - DISTNAME= ${PORTNAME}-${PORTVERSION} is the default and not needed.pgollucci2010-12-301-1/+0 * - Fix distinfo entryacm2010-11-171-1/+1 * - Update to 2.4.2acm2010-11-165-129/+10 * - Change s/LIB_DEPENDS/RUN_DEPENDS on rexx-regina dependency. It solves aacm2010-08-171-1/+1 * - s/NOPORTSDOCS/NOPORTDOCSacm2010-08-171-1/+1 * - Update to 2.4.0acm2010-08-177-36/+303 * Chase the ftp/curl shlib version bump.roam2010-04-031-1/+1 * - update to 1.4.1dinoex2010-03-281-1/+1 * - Fix some more SF URLs, including ones in PATCH_SITES and comments (for cons...amdmi32009-08-281-1/+1 * - Chase fftw3 updatepav2009-05-181-1/+1 * - Fix all MASTER_SITES entries. Now it will compile without problemsacm2009-05-051-8/+7 * - Update to 2.2.4acm2009-05-044-14/+32 * - Update X.org ports to 7.4+ (few ports are more recent than the katamari).flz2009-01-241-2/+1 * Bump the version of the curl shared library after the ftp/curl updateroam2009-01-231-1/+1 * - Remove example files from fpc-gtk1 and fpc-gtk2 ports. It can beacm2009-01-201-2/+0 * - Update to 2.2.2acm2009-01-145-89/+49 * - Remove conditional checks for FreeBSD 5.x and olderpav2009-01-061-5/+2 * - PREFIX is always present in MAKE_ENV, no need to add it againpav2008-07-252-2/+0 * - Use new freepascal stuffacm2008-06-243-34/+37 * - Add a better way to install fpc.cfg config file, now lazarus will compileacm2008-01-073-3/+19 * - Add some missing dependencies, possibly it fixes some build problemsacm2007-11-081-0/+4 * - Update to 2.2.0acm2007-09-184-34/+75 * Attempt to fix build of fpc units on pointyhat.linimon2007-09-171-0/+1 * Switch firebird dependency from hardcoding to USE_FIREBIRD. This switcheslinimon2007-07-251-1/+1 * - Fix Makefiles.units. The devel/fpc-fcl was building without -CX optionacm2006-10-061-1/+1 * - Add a clean solution to compile devel/fpc-fcl, using OPT and removing the rtlacm2006-09-261-1/+4 * - Remove the comment character from ibase sectionacm2006-09-231-1/+1 * - Add OPTIONS to some freepascal ports. Now, we can install the external libsacm2006-09-192-1/+223 * - Update to 2.0.4acm2006-09-084-22/+30 * - Added post-extract on Makefiles.units. It remove the svn directories fromacm2006-07-292-1/+5 * - The big change on ports of freepascal, now all ports are compiledacm2006-07-245-280/+238 * - Update fpc to 2.0.2garga2006-06-228-377/+366 * Remove USE_REINPLACE from the categories starting with Ledwin2006-05-101-1/+0 * - No latest link, to prevent clash with lang/fpc2pav2006-01-151-0/+2 * - Add SHA256pav2005-11-251-0/+1 * - Remove dead MASTER_SITESpav2005-11-241-7/+1 * - Fix after spliting firebirdsem2005-05-181-2/+2 * With portmgr hat on, reset maintainership of these ports. Maintainer'slinimon2005-02-141-1/+1 * - Fix MASTER_SITESkrion2004-05-301-1/+1 * * Fix the build on -CURRENTmarcus2004-02-223-32/+42 * This is broken on 4.x as well.kris2004-02-221-4/+2 * BROKEN on 5.x: install failskris2004-02-071-0/+4 * Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-041-0/+1 * Update to 1.0.10.znerd2004-01-071-0/+11 * Update to 1.0.10.znerd2004-01-074-2649/+187 * * Upgrade to 1.0.6.obraun2003-07-1310-2453/+2729 * Umm, I should bump PORTREVISION...kuriyama2003-07-081-0/+1 * Remove dependency on print/acroread4.kuriyama2003-07-081-3/+0 * gtar is required for 'extract' not 'build'billf2003-06-011-1/+1 * De-pkg-comment.knu2003-02-212-1/+1 * Change of maintainers email address.edwin2002-11-181-1/+1