Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Universal Logging Plugin
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
Unreal-Development
Plugins
Universal Logging Plugin
Commits
8d539baa
Commit
8d539baa
authored
Dec 9, 2021
by
mbellgardt
Browse files
Options
Downloads
Patches
Plain Diff
Change File_Handle raw pointer to unique pointer to make ownership explicit
parent
b607eaab
No related branches found
No related tags found
2 merge requests
!17
fix double Deletion
,
!16
Develop
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/UniversalLogging/Private/LogFileStream.cpp
+2
-6
2 additions, 6 deletions
Source/UniversalLogging/Private/LogFileStream.cpp
Source/UniversalLogging/Private/LogFileStream.h
+1
-1
1 addition, 1 deletion
Source/UniversalLogging/Private/LogFileStream.h
with
3 additions
and
7 deletions
Source/UniversalLogging/Private/LogFileStream.cpp
+
2
−
6
View file @
8d539baa
...
@@ -23,7 +23,7 @@ void LogFileStream::Open()
...
@@ -23,7 +23,7 @@ void LogFileStream::Open()
FString
file_path
=
FPaths
::
ConvertRelativePathToFull
(
FPaths
::
ProjectDir
()
+
Filepath
);
FString
file_path
=
FPaths
::
ConvertRelativePathToFull
(
FPaths
::
ProjectDir
()
+
Filepath
);
platform_file
.
CreateDirectoryTree
(
*
file_path
);
platform_file
.
CreateDirectoryTree
(
*
file_path
);
file_path
=
FPaths
::
Combine
(
file_path
,
Filename
);
file_path
=
FPaths
::
Combine
(
file_path
,
Filename
);
File_Handle
=
platform_file
.
OpenWrite
(
*
file_path
);
File_Handle
.
Reset
(
platform_file
.
OpenWrite
(
*
file_path
)
)
;
if
(
!
File_Handle
)
if
(
!
File_Handle
)
{
{
UE_LOG
(
LogUni
,
Error
,
TEXT
(
"Universal Logging: The file %s could not be opened for writing."
),
*
file_path
);
UE_LOG
(
LogUni
,
Error
,
TEXT
(
"Universal Logging: The file %s could not be opened for writing."
),
*
file_path
);
...
@@ -35,11 +35,7 @@ void LogFileStream::Open()
...
@@ -35,11 +35,7 @@ void LogFileStream::Open()
void
LogFileStream
::
Close
()
void
LogFileStream
::
Close
()
{
{
if
(
File_Handle
)
File_Handle
.
Reset
();
{
delete
File_Handle
;
}
File_Handle
=
nullptr
;
bIs_Open
=
false
;
bIs_Open
=
false
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Source/UniversalLogging/Private/LogFileStream.h
+
1
−
1
View file @
8d539baa
...
@@ -15,5 +15,5 @@ private:
...
@@ -15,5 +15,5 @@ private:
const
FString
Filepath
;
const
FString
Filepath
;
const
FString
Filename
;
const
FString
Filename
;
bool
bIs_Open
;
bool
bIs_Open
;
IFileHandle
*
File_Handle
;
TUniquePtr
<
IFileHandle
>
File_Handle
;
};
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment