Fix 'Object has been destroyed' when FreeTube is passed a URL with no windows open on macOS#6278
Merged
FreeTubeBot merged 5 commits intoFreeTubeApp:developmentfrom Dec 9, 2024
Merged
Conversation
on macOS when attempting to open URL with no windows open
absidue
reviewed
Dec 4, 2024
auto-merge was automatically disabled
December 5, 2024 00:40
Head branch was pushed to by a user without write access
auto-merge was automatically disabled
December 5, 2024 00:48
Pull request was converted to draft
(trying to launch a second instance wouldn't have focused main window)
OothecaPickle
commented
Dec 5, 2024
PikachuEXE
approved these changes
Dec 5, 2024
Member
PikachuEXE
left a comment
There was a problem hiding this comment.
Tested on macOS 13.7.1
Bug has been destroyed
Collaborator
|
Don't currently have access to a Mac to validate, but looks good from static analysis of the code. |
Member
|
@kommunarr will you have access to it anytime soon or should we go ahead and approve this PR as @PikachuEXE tested it on their machine? |
efb4f5ff-1298-471a-8973-3d47447115dc
approved these changes
Dec 9, 2024
absidue
approved these changes
Dec 9, 2024
PikachuEXE
added a commit
to PikachuEXE/FreeTube
that referenced
this pull request
Dec 10, 2024
* development: (96 commits) Move Invidious API calls into Invidious file (FreeTubeApp#6313) Translated using Weblate (Spanish) Use word-break on live chat error message (FreeTubeApp#6327) Bump youtubei.js from 11.0.1 to 12.0.0 (FreeTubeApp#6323) Bump shaka-player from 4.12.3 to 4.12.4 (FreeTubeApp#6318) Make seekbar and player controls appear at bottom of video and take full width (FreeTubeApp#6007) Fix 'Object has been destroyed' when FreeTube is passed a URL with no windows open on macOS (FreeTubeApp#6278) Bump mikefarah/yq from 4.44.5 to 4.44.6 (FreeTubeApp#6324) Translated using Weblate (French) Bump sass-loader from 16.0.3 to 16.0.4 (FreeTubeApp#6319) Bump webpack from 5.96.1 to 5.97.1 (FreeTubeApp#6322) Bump sass from 1.81.0 to 1.82.0 (FreeTubeApp#6320) Bump lefthook from 1.8.5 to 1.9.0 (FreeTubeApp#6321) Bump @intlify/eslint-plugin-vue-i18n from 3.1.0 to 3.2.0 (FreeTubeApp#6317) Translated using Weblate (Estonian) Translated using Weblate (Basque) Translated using Weblate (Icelandic) Translated using Weblate (Hungarian) Translated using Weblate (German) Fix channel home page list view (FreeTubeApp#6316) ...
This was referenced Dec 18, 2024
SuperAKWA
pushed a commit
to SuperAKWA/FreeTube
that referenced
this pull request
Jan 24, 2025
… windows open on macOS (FreeTubeApp#6278) * fix 'Object has been destroyed' error on macOS when attempting to open URL with no windows open * add comment * handle URLs passed via command line with no open windows on macOS * refactor recent changes to URL handling * fix regression (trying to launch a second instance wouldn't have focused main window)
OothecaPickle
added a commit
to OothecaPickle/FreeTube
that referenced
this pull request
Apr 29, 2025
… windows open on macOS (FreeTubeApp#6278) * fix 'Object has been destroyed' error on macOS when attempting to open URL with no windows open * add comment * handle URLs passed via command line with no open windows on macOS * refactor recent changes to URL handling * fix regression (trying to launch a second instance wouldn't have focused main window)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix 'Object has been destroyed' when FreeTube is passed a URL with no windows open on macOS
Pull Request Type
Related issue
Relates to @srolandmarshall's comment on #4762 (but unrelated to the issue commented on).
Description
Because FreeTube does not quit automatically when all windows are closed on macOS (as on other plaforms), the main process tries to fire an IPC message to a non-existent
mainWindowwhen it receives anopen-urlevent or a command line URL argument. This results in anObject has been destroyederror message.This PR sets
mainWindowtonullwhen all FreeTube windows have been closed, and, when this is the case, has the main process create a new window and pass it a URL to be opened onopen-url(ifapp.isReady()istrue) orsecond-instance(with a command line URL argument) events.Screenshots
Testing
freetube://link (deep link).Desktop
Additional context