You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/10/12 15:11:21 UTC

[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

szaszm commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r727238354



##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       Why does deferred initialization help? Doesn't it just delay the creation of the file?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org