Skip to content

Commit 3122de8

Browse files
authored
Bugfixes for asset paths and exit error log (#1)
## Summary Tiny bugfixes, for compatibility across build platforms and multi-thread stability ### Details * Change the asset path name to avoid missing assets when built on a case-sensitive platform * Fix the std::exception error log when exiting the sample apps ## Verification - [x] Use gradle build script to build all three samples. Running them on PICO 4 ULTRA gives results as expected. Signed-off-by: Yunhao Liu <yunhao.liu@bytedance.com>
1 parent 850ff66 commit 3122de8

7 files changed

Lines changed: 15 additions & 3 deletions

File tree

base/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ void android_main(struct android_app* app) {
273273
program->PollActions();
274274
program->RenderFrame();
275275
}
276-
app->activity->vm->DetachCurrentThread();
277276
program->DestroySecureMr();
277+
app->activity->vm->DetachCurrentThread();
278278
} catch (const std::exception& ex) {
279279
Log::Write(Log::Level::Error, ex.what());
280280
} catch (...) {

samples/pose/cpp/pose_detection.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ PoseDetector::PoseDetector(const XrInstance& instance, const XrSession& session)
4848

4949
PoseDetector::~PoseDetector() {
5050
keepRunning = false;
51+
if (pipelineInitializer && pipelineInitializer->joinable()) {
52+
pipelineInitializer->join();
53+
}
5154
for (auto& runner : pipelineRunners) {
5255
if (runner.joinable()) runner.join();
5356
}

samples/ufo/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ android {
4747
sourceSets {
4848
getByName("main") {
4949
manifest.srcFile("AndroidManifest.xml")
50-
assets.srcDirs("../../assets/common", "../../assets/ufo")
50+
assets.srcDirs("../../assets/common", "../../assets/UFO")
5151
}
5252
}
5353
packaging {

samples/ufo/cpp/face_tracking.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ FaceTracker::FaceTracker(const XrInstance& instance, const XrSession& session)
4444

4545
FaceTracker::~FaceTracker() {
4646
keepRunning = false;
47+
if (pipelineInitializer && pipelineInitializer->joinable()) {
48+
pipelineInitializer->join();
49+
}
4750
for (auto& runner : pipelineRunners) {
4851
if (runner.joinable()) runner.join();
4952
}

samples/ufo_origin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ android {
4848
sourceSets {
4949
getByName("main") {
5050
manifest.srcFile("AndroidManifest.xml")
51-
assets.srcDirs("../../assets/common", "../../assets/ufo")
51+
assets.srcDirs("../../assets/common", "../../assets/UFO")
5252
}
5353
}
5454
packaging {

samples/ufo_origin/cpp/face_tracking_raw.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ FaceTrackingRaw::FaceTrackingRaw(const XrInstance &instance, const XrSession &se
1010

1111
FaceTrackingRaw::~FaceTrackingRaw() {
1212
keepRunning = false;
13+
if (pipelineInitializer && pipelineInitializer->joinable()) {
14+
pipelineInitializer->join();
15+
}
1316
for (auto &runner : pipelineRunners) {
1417
if (runner.joinable()) runner.join();
1518
}

samples/yolo_det/cpp/yolo_object_detection.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ YoloDetector::YoloDetector(const XrInstance& instance, const XrSession& session)
4747

4848
YoloDetector::~YoloDetector() {
4949
keepRunning = false;
50+
if (pipelineInitializer && pipelineInitializer->joinable()) {
51+
pipelineInitializer->join();
52+
}
5053
for (auto& runner : pipelineRunners) {
5154
if (runner.joinable()) runner.join();
5255
}

0 commit comments

Comments
 (0)