Skip to content

Commit fae4268

Browse files
committed
Fix evil bug
1 parent ab0d661 commit fae4268

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.0.3
2+
- Fix a cocos bug
3+
14
## 2.0.2
25
- Bug fix
36

mod.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"geode": "4.6.1",
2+
"geode": "4.6.2",
33
"gd": {
44
"win": "2.2074",
55
"android": "2.2074",
66
"mac": "2.2074",
77
"ios": "2.2074"
88
},
9-
"version": "v2.0.2",
9+
"version": "v2.0.3",
1010
"id": "alphalaneous.happy_textures",
1111
"name": "Happy Textures :3",
1212
"developer": "Alphalaneous",

src/NodeModding.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <Geode/Geode.hpp>
44
#include <Geode/modify/CCObject.hpp>
55
#include <Geode/modify/CCPoolManager.hpp>
6+
#include <Geode/modify/CCDictionary.hpp>
67
#include "UIModding.hpp"
78
#include "nodes/CCNode.hpp"
89
#include "Utils.hpp"
@@ -37,6 +38,22 @@ class LateQueue {
3738
};
3839
LateQueue* LateQueue::instance = nullptr;
3940

41+
class $modify(CCDictionary) {
42+
43+
// Cocos will call autorelease on a nullptr here for some reason,
44+
// it doesn't crash due to no member access but will crash with this
45+
// mod since I retain and release which access m_uReference
46+
47+
static CCDictionary* createWithContentsOfFile(const char *pFileName) {
48+
if (auto ret = CCDictionary::createWithContentsOfFileThreadSafe(pFileName)) {
49+
ret->autorelease();
50+
return ret;
51+
}
52+
53+
return nullptr;
54+
}
55+
};
56+
4057
class $modify(CCObject) {
4158

4259
CCObject* autorelease() {

0 commit comments

Comments
 (0)