Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small cleanups for the File Transfer portal code #1574

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

GeorgesStavracas
Copy link
Member

No description provided.

@GeorgesStavracas GeorgesStavracas added the portal: file transfer File Transfer portal label Jan 16, 2025
Comment on lines -147 to +155
FileTransfer *transfer;
g_autoptr(FileTransfer) transfer = NULL;

G_LOCK (transfers);
transfer = (FileTransfer *)g_hash_table_lookup (transfers, key);
if (transfer)
g_object_ref (transfer);
G_UNLOCK (transfers);

return transfer;
return g_steal_pointer (&transfer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transfer actually isn't owning the FileTransfer for some time which is a bit awkward. Maybe it gets more readable by ref-ing at the return?

  FileTransfer *transfer;

  G_LOCK (transfers);
  transfer = (FileTransfer *)g_hash_table_lookup (transfers, key);
  G_UNLOCK (transfers);
  
  if (!transfer)
    return NULL;

  return g_object_ref (transfer);

@swick
Copy link
Contributor

swick commented Jan 16, 2025

LGTM, one nit pick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
portal: file transfer File Transfer portal
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

2 participants