Skip to content

Commit

Permalink
AppleSpell provider: update to use correct destructor methods
Browse files Browse the repository at this point in the history
Add missing enchant_provider_free to enchant-provider.h
  • Loading branch information
rrthomas committed Aug 16, 2024
1 parent 5d0a042 commit ed28fa5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions lib/enchant-provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ void enchant_dict_set_error (EnchantDict * dict, const char * const err);
*/
EnchantProvider *enchant_provider_new (void);

/**
* enchant_provider_free
*
* Frees an EnchantProvider.
*/
void enchant_provider_unref (EnchantProvider * provider);
#define enchant_provider_free enchant_provider_unref

/**
* enchant_provider_set_error
* @provider: A non-null provider
Expand Down
6 changes: 3 additions & 3 deletions providers/applespell_checker.mm
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static int appleSpell_dict_check (EnchantDict * me, const char * const word, siz
AppleSpellDictionary * ASD = g_new0 (AppleSpellDictionary, 1);
if (!ASD)
{
g_free (dict);
enchant_broker_free_dict (me->owner, dict);
return 0;
}

Expand All @@ -324,7 +324,7 @@ static int appleSpell_dict_check (EnchantDict * me, const char * const word, siz
if (!ASD->DictionaryName)
{
g_free (ASD);
g_free (dict);
enchant_broker_free_dict (me->owner, dict);
return 0;
}

Expand Down Expand Up @@ -443,7 +443,7 @@ static void appleSpell_provider_dispose (EnchantProvider * me)
}
else
{
g_free (provider);
enchant_provider_free (provider);
provider = 0;
}

Expand Down

0 comments on commit ed28fa5

Please sign in to comment.