Skip to content

Commit 46bd1f5

Browse files
committed
Compile warning
1 parent ba33258 commit 46bd1f5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/FileSystems/FileSystemMemory.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,12 @@ class FileSystemMemory : public FileSystem {
271271
}
272272
break;
273273
case SEEK_END:
274-
p_memory->current_pos = p_memory->size - offset;
274+
long pos = p_memory->size - offset;
275275
if (p_memory->current_pos < 0) {
276276
p_memory->current_pos = 0;
277277
offset = offset + p_memory->current_pos;
278+
} else {
279+
p_memory->current_pos = pos;
278280
}
279281
break;
280282
}

src/FileSystems/Registry.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,18 @@ struct RegContent {
8888
*/
8989
struct RegEntry {
9090
RegEntry() = default;
91-
~RegEntry() {
91+
virtual ~RegEntry() {
92+
assert(memory_guard==12345);
93+
#ifdef ESP32
94+
assert(heap_caps_check_integrity_all(true));
95+
#endif
9296
if (content != nullptr) {
9397
FS_LOGD("~RegEntry: %s", file_name);
9498
delete content;
9599
content = nullptr;
96100
}
97101
}
102+
int memory_guard = 12345;
98103
/// reference to the file system
99104
FileSystem *p_file_system = nullptr;
100105
/// the name of the file

0 commit comments

Comments
 (0)