Closed cosmin42 closed 3 weeks ago
[!CAUTION]
Review failed
The pull request is closed.
The changes introduced in this pull request enhance the functionality of the OGLEngine
class for Apple platforms by adding a thread scheduler configuration method and a member variable for managing threading behavior. Modifications in various files include updates to initialization processes, memory management improvements, and adjustments to project configuration paths. The changes ensure that threading tasks are managed more effectively, particularly for macOS, while also refining the initialization of related components in the PhotoBook
application.
File Path | Change Summary |
---|---|
PB/include/pb/components/OGLEngine.h | Added method void configureThreadScheduler(PBDev::ThreadScheduler* threadScheduler) and member variable PBDev::ThreadScheduler* mThreadScheduler = nullptr; for Apple platforms. |
PB/src/OGLEngine.cpp | Defined configureThreadScheduler method and updated mainloop to utilize mThreadScheduler for task posting, ensuring thread-safe execution on macOS. |
PB/src/PhotoBook.cpp | Added include for pb/Config.h and configured mOGLEngine with a thread scheduler in the constructor. Minor formatting change for newline at file end. |
osx/PhotoBook/PhotoBook.xcodeproj/project.pbxproj | Updated header and library search paths from ../../PB/include to ../../pb/include and ../../PB/build to ../../pb/build for multiple build configurations. |
osx/PhotoBook/PhotoBook/DashboardView.swift | Modified DashboardView to call self.photobook.start() in .onAppear() instead of the initializer, changing the timing of the method call. |
osx/PhotoBook/PhotoBook/PhotoBookApp.swift | Initialized photobook directly at declaration and changed photobookListenerWrapperCLevel from mutable to constant. |
osx/PhotoBook/PhotoBook/Photobook.mm | Changed mPhotobook to use std::shared_ptr<PB::Photobook> for improved memory management and updated post method in PhotobookListenerManaged to dispatch tasks on the main queue. |
In the land of code where rabbits play,
New threads are woven, come what may.
With schedulers hopping, tasks in line,
OurOGLEngine
dances, all will be fine!
So let’s cheer for changes, both big and small,
In the world ofPhotoBook
, we’ll conquer all! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
Release Notes
New Features
OGLEngine
class.photobook
object in thePhotoBookApp
for streamlined setup.Bug Fixes
start()
method inDashboardView
to ensure it runs at the appropriate lifecycle phase.Refactor
Photobook
class to utilize smart pointers, improving resource handling.Chores