Skip to content

Commit cfff2fe

Browse files
committed
Bugfix.
1 parent 86ac9d8 commit cfff2fe

File tree

4 files changed

+24
-18
lines changed

4 files changed

+24
-18
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Changelog
22
=======
33

4+
### 1.0.6 (31)
5+
New features:
6+
- Application menu item to install/reveal the CLI tool on `/usr/local/bin` folder.
7+
- Support for UTI `public.markdown` defined by `Nova.app`.
8+
Bugfix:
9+
- Fixed possibile deallocation error with invalid highlight theme.
10+
411
### 1.0.5 (30)
512
Bugfix:
613
- Tag Filter extension fixed.

QLMarkdown.xcodeproj/project.pbxproj

+8-8
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@
14261426
CODE_SIGN_ENTITLEMENTS = QLExtension/QLExtension.entitlements;
14271427
CODE_SIGN_IDENTITY = "-";
14281428
CODE_SIGN_STYLE = Manual;
1429-
CURRENT_PROJECT_VERSION = 30;
1429+
CURRENT_PROJECT_VERSION = 31;
14301430
DEVELOPMENT_TEAM = "";
14311431
ENABLE_HARDENED_RUNTIME = NO;
14321432
HEADER_SEARCH_PATHS = (
@@ -1447,7 +1447,7 @@
14471447
"$(PROJECT_DIR)/re2",
14481448
);
14491449
MACOSX_DEPLOYMENT_TARGET = 10.15;
1450-
MARKETING_VERSION = 1.0.5;
1450+
MARKETING_VERSION = 1.0.6;
14511451
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.QLMarkdown.QLExtension;
14521452
PRODUCT_NAME = "$(TARGET_NAME)";
14531453
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1464,7 +1464,7 @@
14641464
CODE_SIGN_ENTITLEMENTS = QLExtension/QLExtension.entitlements;
14651465
CODE_SIGN_IDENTITY = "-";
14661466
CODE_SIGN_STYLE = Manual;
1467-
CURRENT_PROJECT_VERSION = 30;
1467+
CURRENT_PROJECT_VERSION = 31;
14681468
DEVELOPMENT_TEAM = "";
14691469
ENABLE_HARDENED_RUNTIME = NO;
14701470
HEADER_SEARCH_PATHS = (
@@ -1485,7 +1485,7 @@
14851485
"$(PROJECT_DIR)/re2",
14861486
);
14871487
MACOSX_DEPLOYMENT_TARGET = 10.15;
1488-
MARKETING_VERSION = 1.0.5;
1488+
MARKETING_VERSION = 1.0.6;
14891489
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.QLMarkdown.QLExtension;
14901490
PRODUCT_NAME = "$(TARGET_NAME)";
14911491
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1671,7 +1671,7 @@
16711671
CODE_SIGN_IDENTITY = "-";
16721672
CODE_SIGN_STYLE = Manual;
16731673
COMBINE_HIDPI_IMAGES = YES;
1674-
CURRENT_PROJECT_VERSION = 30;
1674+
CURRENT_PROJECT_VERSION = 31;
16751675
DEVELOPMENT_TEAM = "";
16761676
ENABLE_HARDENED_RUNTIME = NO;
16771677
FRAMEWORK_SEARCH_PATHS = (
@@ -1697,7 +1697,7 @@
16971697
"$(PROJECT_DIR)/re2",
16981698
);
16991699
MACOSX_DEPLOYMENT_TARGET = 10.15;
1700-
MARKETING_VERSION = 1.0.5;
1700+
MARKETING_VERSION = 1.0.6;
17011701
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.QLMarkdown;
17021702
PRODUCT_NAME = "$(TARGET_NAME)";
17031703
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1718,7 +1718,7 @@
17181718
CODE_SIGN_IDENTITY = "-";
17191719
CODE_SIGN_STYLE = Manual;
17201720
COMBINE_HIDPI_IMAGES = YES;
1721-
CURRENT_PROJECT_VERSION = 30;
1721+
CURRENT_PROJECT_VERSION = 31;
17221722
DEVELOPMENT_TEAM = "";
17231723
ENABLE_HARDENED_RUNTIME = NO;
17241724
FRAMEWORK_SEARCH_PATHS = (
@@ -1744,7 +1744,7 @@
17441744
"$(PROJECT_DIR)/re2",
17451745
);
17461746
MACOSX_DEPLOYMENT_TARGET = 10.15;
1747-
MARKETING_VERSION = 1.0.5;
1747+
MARKETING_VERSION = 1.0.6;
17481748
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.QLMarkdown;
17491749
PRODUCT_NAME = "$(TARGET_NAME)";
17501750
PROVISIONING_PROFILE_SPECIFIER = "";

highlight-wrapper/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ CFLAGS=-Wall -std=c++11 -D_FILE_OFFSET_BITS=64 \
2626
-I ${BUILD_DIR}
2727
LDFLAGS=-L${BUILD_DIR}
2828

29-
CFLAGS_x86_64=-mmacosx-version-min=10.15
29+
CFLAGS_x86_64=-target x86_64-apple-macos10.15
3030
CFLAGS_arm64=-target arm64-apple-macos11
3131

32-
LDFLAGS_x86_64=
32+
LDFLAGS_x86_64=-target x86_64-apple-macos10.15
3333
LDFLAGS_arm64=-target arm64-apple-macos11
3434

3535
ifeq ($(CONFIGURATION),Debug)
@@ -357,4 +357,4 @@ clean: clean_intermediate
357357
@rm ${BUILD_DIR}/liblua-arm64.a 2> /dev/null
358358
@rm ${BUILD_DIR}/libgoutils.a 2> /dev/null
359359
@rm ${BUILD_DIR}/libgoutils-x86_64.a 2> /dev/null
360-
@rm ${BUILD_DIR}/libgoutils-arm64.a 2> /dev/null
360+
@rm ${BUILD_DIR}/libgoutils-arm64.a 2> /dev/null

highlight-wrapper/wrapper_highlight.cpp

+6-7
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,6 @@ int highlight_list_themes2(HThemeInfo ***theme_list, int *count, ReleaseThemeInf
494494
string suffix, desc;
495495
Diluculum::LuaValueMap categoryMap;
496496

497-
int matchedFileCnt=0;
498497
std::set<string> categoryNames;
499498

500499
istringstream valueStream;
@@ -504,9 +503,10 @@ int highlight_list_themes2(HThemeInfo ***theme_list, int *count, ReleaseThemeInf
504503
int j = 0;
505504

506505
for (const auto& filePath : filePaths) {
506+
HThemeInfo *theme;
507507
try {
508-
HThemeInfo *theme = allocate_theme_info();
509-
508+
theme = allocate_theme_info();
509+
510510
Diluculum::LuaState ls;
511511
highlight::SyntaxReader::initLuaState(ls, filePath, "");
512512
ls.doFile(filePath);
@@ -529,21 +529,20 @@ int highlight_list_themes2(HThemeInfo ***theme_list, int *count, ReleaseThemeInf
529529
suffix = suffix.substr ( 1, suffix.length()- wildcard.length() );
530530

531531
theme->name = strdup(suffix.c_str());
532-
theme->desc = strdup(ls["Description"].value().asString().c_str());
532+
theme->desc = strdup(desc.c_str());
533533
theme->path = strdup(filePath.c_str());
534534
theme->base16 = filePath.rfind(base_path16, 0) == 0 ? 1 : 0;
535535

536-
537536
themes[j] = theme;
538537
j++;
539-
540-
matchedFileCnt++;
541538
} catch (std::runtime_error &error) {
542539
os_log_error(sLog, "Failed to read '%{public}s': %{public}s", filePath.c_str(), error.what());
540+
release_theme_info(theme);
543541
}
544542
}
545543

546544
*theme_list = themes;
545+
*count = j;
547546

548547
return EXIT_SUCCESS;
549548
}

0 commit comments

Comments
 (0)