Skip to content

Commit

Permalink
Fix some more leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
techee committed May 21, 2024
1 parent 4e6be72 commit d9668e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lsp/src/lsp-semtokens.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ static void cached_data_free(CachedData *data)
g_array_free(data->tokens, TRUE);
g_free(data->tokens_str);
g_free(data->result_id);
g_free(data);
}


Expand Down Expand Up @@ -120,6 +121,7 @@ static SemanticTokensEdit *sem_tokens_edit_new(void)
static void sem_tokens_edit_free(SemanticTokensEdit *edit)
{
g_array_free(edit->data, TRUE);
g_free(edit);
}


Expand Down
4 changes: 3 additions & 1 deletion lsp/src/lsp-signature.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ void lsp_signature_show_next(void)
void lsp_signature_send_request(LspServer *server, GeanyDocument *doc, gboolean force)
{
GVariant *node;
gchar *doc_uri;
LspSignatureData *data;
ScintillaObject *sci = doc->editor->sci;
gint pos = sci_get_current_position(sci);
LspPosition lsp_pos = lsp_utils_scintilla_pos_to_lsp(sci, pos);
gchar *doc_uri = lsp_utils_get_doc_uri(doc);
gchar c = pos > 0 ? sci_get_char_at(sci, SSM(sci, SCI_POSITIONBEFORE, pos, 0)) : '\0';
gint lexer = sci_get_lexer(sci);
gint style = sci_get_style_at(sci, pos);
Expand All @@ -169,6 +169,8 @@ void lsp_signature_send_request(LspServer *server, GeanyDocument *doc, gboolean
return;
}

doc_uri = lsp_utils_get_doc_uri(doc);

node = JSONRPC_MESSAGE_NEW (
"textDocument", "{",
"uri", JSONRPC_MESSAGE_PUT_STRING(doc_uri),
Expand Down

0 comments on commit d9668e7

Please sign in to comment.