Index: src/OFEmbeddedURIHandler.h ================================================================== --- src/OFEmbeddedURIHandler.h +++ src/OFEmbeddedURIHandler.h @@ -27,11 +27,13 @@ * @brief Register a file for the `embedded:` URI scheme. * * Usually, you should not use the directly, but rather generate a source file * for a file to be embedded using the `objfw-embed` tool. * - * @param path The path to the file under the `embedded:` scheme + * @param path The path to the file under the `embedded:` scheme. This is not + * retained, so you must either pass a constant string or pass a + * string that is already retained! * @param bytes The raw bytes for the file * @param size The size of the file */ extern void OFRegisterEmbeddedFile(OFString *path, const uint8_t *bytes, size_t size); Index: src/OFEmbeddedURIHandler.m ================================================================== --- src/OFEmbeddedURIHandler.m +++ src/OFEmbeddedURIHandler.m @@ -59,11 +59,11 @@ embeddedFiles = realloc(embeddedFiles, sizeof(*embeddedFiles) * (numEmbeddedFiles + 1)); OFEnsure(embeddedFiles != NULL); - embeddedFiles[numEmbeddedFiles].path = [path retain]; + embeddedFiles[numEmbeddedFiles].path = path; embeddedFiles[numEmbeddedFiles].bytes = bytes; embeddedFiles[numEmbeddedFiles].size = size; numEmbeddedFiles++; #ifdef OF_HAVE_THREADS