Skip to content

Fix potential crash in asset viewer#19

Merged
NSAntoine merged 1 commit intoNSAntoine:mainfrom
samhenrigold:main
Oct 11, 2025
Merged

Fix potential crash in asset viewer#19
NSAntoine merged 1 commit intoNSAntoine:mainfrom
samhenrigold:main

Conversation

@samhenrigold
Copy link
Copy Markdown
Contributor

Fixes a potential crash caused by unsafe reference in scroll notification handler. Changed [unowned self] to [weak self] and added proper cleanup of notification observer in deinit to prevent accessing deallocated view controller.

Crash log that sparked this:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               Samra [2744]
Path:                  /Users/USER/Downloads/Samra.app/Contents/MacOS/Samra
Identifier:            com.serena.Samra
Version:               1 (1.4)
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2024-12-08 17:32:27.6506 -0500
OS Version:            macOS 15.1.1 (24B91)
Report Version:        12
Anonymous UUID:        1ED1F224-511F-08C2-995E-C72747367227

Sleep/Wake UUID:       735F8F37-5179-4987-BE1D-7BF100AD7D84

Time Awake Since Boot: 78000 seconds
Time Since Wake:       6867 seconds

System Integrity Protection: disabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000

Termination Reason:    Namespace SIGNAL, Code 6 Abort trap: 6
Terminating Process:   Samra [2744]

Application Specific Information:
abort() called


Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	       0x1954a6600 __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x1954def70 pthread_kill + 288
2   libsystem_c.dylib             	       0x1953eb908 abort + 128
3   libswiftCore.dylib            	       0x1a6509e6c swift::fatalErrorv(unsigned int, char const*, char*) + 136
4   libswiftCore.dylib            	       0x1a6509e8c swift::fatalError(unsigned int, char const*, ...) + 32
5   libswiftCore.dylib            	       0x1a650a050 swift::swift_abortRetainUnowned(void const*) + 32
6   libswiftCore.dylib            	       0x1a6579124 swift_unknownObjectUnownedLoadStrong + 76
7   Samra.debug.dylib             	       0x102da7b8c closure #4 in RenditionListViewController.loadView() + 252
8   Samra.debug.dylib             	       0x102da84f8 thunk for @escaping @callee_guaranteed @Sendable (@in_guaranteed Notification) -> () + 160

@NSAntoine NSAntoine merged commit be8ee78 into NSAntoine:main Oct 11, 2025
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

Successfully merging this pull request may close these issues.

2 participants