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

Be more precise on how to use appimage_registered_desktop_file_path() #185

Open
darealshinji opened this issue Jun 19, 2023 · 0 comments
Open

Comments

@darealshinji
Copy link

The comment in appimage.h isn't clear on what char* md5 is for and doesn't tell me that the returned string should (apparently) be free()d later:

/*
 * Finds the desktop file of a registered AppImage and returns the path
 * Returns NULL if the desktop file can't be found, which should only occur when the AppImage hasn't been registered yet
 */
char* appimage_registered_desktop_file_path(const char* path, char* md5, bool verbose);

This is a piece of code where I use it. I hope it's used correct.

    char *ptr = appimage_registered_desktop_file_path(to.c_str(), NULL, true);

    if (ptr) {
        std::cout << "Desktop file installed at \"" << ptr << "\"" << std::endl;
        free((void *)ptr);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant